I have a table which has 2 fields (latitude, longitude) and many other fields. I want to select the distinct combinations of latitude and longitude from this table.
What would be the query for that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Simply use the
DISTINCTkeyword:This will return values where the
(Latitude, Longitude)combination is unique.This example supposes that you do not need the other columns. If you do need them, i.e. the table has
Latitude, Longitude, LocationNamecolumns, you could either addLocationNameto the distinct list, or use something along the lines of: