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)


how about:

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

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, privacy policy and cookie policy

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