snipt

Ctrl+h for KB shortcuts
Notice: Snipt is moving away from free accounts on May 1st, 2014. Read more about the transition here.
#31272

SQL

Get Facebook's places nearby

SELECT page_id, name, description, latitude, longitude, checkin_count, distance(latitude, longitude, '24.746296265934', '121.74880073232') FROM place WHERE distance(latitude, longitude, '24.746296265934', '121.74880073232') < 1000
https://snipt.net/embed/4505b8e2a8be1ede10b0b2f9372bae12/
https://snipt.net/raw/4505b8e2a8be1ede10b0b2f9372bae12/
4505b8e2a8be1ede10b0b2f9372bae12
sql
SQL
1
2014-04-21T16:23:00
True
False
/api/public/snipt/31272/
get-facebooks-places-nearby
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">SELECT</span> <span class="n">page_id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">latitude</span><span class="p">,</span> <span class="n">longitude</span><span class="p">,</span> <span class="n">checkin_count</span><span class="p">,</span> <span class="n">distance</span><span class="p">(</span><span class="n">latitude</span><span class="p">,</span> <span class="n">longitude</span><span class="p">,</span> <span class="s1">&#39;24.746296265934&#39;</span><span class="p">,</span> <span class="s1">&#39;121.74880073232&#39;</span><span class="p">)</span> <span class="k">FROM</span> <span class="n">place</span> <span class="k">WHERE</span> <span class="n">distance</span><span class="p">(</span><span class="n">latitude</span><span class="p">,</span> <span class="n">longitude</span><span class="p">,</span> <span class="s1">&#39;24.746296265934&#39;</span><span class="p">,</span> <span class="s1">&#39;121.74880073232&#39;</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">1000</span> </span></pre></div> </td></tr></table>
checkin, facebook, fql, places