Posted by bref Fri 2nd Mar 2007 16:11 - Syntax is SQL - 29 views
Download | New Post | Modify | Hide line numbers
  1. SELECT asciiname,latitude,longitude, acos(SIN( PI()* 0 /180 )*SIN( PI()*latitude/180 )
  2. )+(cos(PI()* 0 /180)*COS( PI()*latitude/180) *COS(PI()*longitude/180-PI()* -73.99319 /180)
  3. )* 3963.191 AS distance
  4. FROM allcountries
  5. WHERE 1=1
  6. AND 3963.191 * ACOS( (SIN(PI()* 0 /180)*SIN(PI() * latitude/180)) +
  7. (COS(PI()* 0 /180)*cos(PI()*latitude/180)*COS(PI() * longitude/180-PI()* -73.99319 /180))
  8. ) < = 1.5
  9. ORDER BY 3963.191 * ACOS(
  10. (SIN(PI()* 0 /180)*SIN(PI()*latitude/180)) +
  11. (COS(PI()* 0 /180)*cos(PI()*latitude/180)*COS(PI() * longitude/180-PI()* -73.99319 /180))
  12. )

PermaLink to this entry https://pastebin.co.uk/11299
Posted by bref Fri 2nd Mar 2007 16:11 - Syntax is SQL - 29 views
Download | New Post | Modify | Hide line numbers

 

Comments: 0