dflow Posted February 12, 2012 Share Posted February 12, 2012 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 https://forums.phpfreaks.com/topic/256930-select-distinct-coordinate/ Share on other sites More sharing options...
requinix Posted February 12, 2012 Share Posted February 12, 2012 i want to choose only one name from the list according to the GPS coordinates Which one? Random? First? First in what order? Link to comment https://forums.phpfreaks.com/topic/256930-select-distinct-coordinate/#findComment-1317180 Share on other sites More sharing options...
dflow Posted February 12, 2012 Author Share Posted February 12, 2012 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 https://forums.phpfreaks.com/topic/256930-select-distinct-coordinate/#findComment-1317182 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.