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
https://forums.phpfreaks.com/topic/256930-select-distinct-coordinate/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.