Jump to content

SELECT distinct coordinate


dflow

Recommended Posts

i have a db with different names for the same place

i want to choose only one name from the list according to the GPS coordinates

 

how would one select a distinct city_name from a list with same GPS coordinates and (that is 2 operands)

 

CREATE TABLE `worldcitylist` (
  `country_id` int(11) NOT NULL,
  `countrycode` varchar(2) NOT NULL,
  `city_name` varchar(255) NOT NULL DEFAULT '',
  `region_id` varchar(100) NOT NULL,
  `Lat` float(17,15) NOT NULL,
  `Lng` float(17,15) NOT NULL,
  `city_id` int(11) NOT NULL AUTO_INCREMENT,
  UNIQUE KEY `id` (`city_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1  ;

Link to comment
Share on other sites

i want to choose only one name from the list according to the GPS coordinates

Which one? Random? First? First in what order?

actually i don't know, the list is too long and places have different ways of being spelled.(i'll need to decide on that later)

let's say Random at first

 

for example the following name for a place in Andora

 

country_id,countrycode,City,city_name,region_id,Lat,Lng,city_id

127,ad,bicisarri,Biçisarri,06,42.483333587646484,1.466666698455811,10017

127,ad,bixessarri,Bixessarri,06,42.483333587646484,1.466666698455811,10018

127,ad,bixisarri,Bixisarri,06,42.483333587646484,1.466666698455811,10019

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.