1

I have table with latitude & longitude columns in SQL. how can I select all records with lat-long 60 degree North or greater (Arctic Region)

2 Answers 2

4

how about:

select * from table where latitude > 60.0;
2
  • its not giving correct result. Commented Jun 13, 2011 at 8:55
  • 1
    in what way is it not correct?
    – Ian Turton
    Commented Jun 13, 2011 at 17:01
0

One thing to consider is that if you have a large dataset then defining your data using lat / long, instead of using a real GIS geometry like PostGIS geography or geometry, prevents you from building spatial indexes on your data. You could get by with building a B+-tree index on your latitude field for the query iant provided, but the moment you need to start doing queries involving both longitude and latitude your indexes will perform sub-par (even if you have two separate indexes on both lat and lon).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.