GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
All cities  XML
Forum Index -> General
Author Message
Harpagophyt



Joined: 07/06/2008 13:58:13
Messages: 6
Offline

Hello,

how is it possible to get all cities with alternatenames in one table?

I tried:
Code:
 CREATE TABLE geoname.cities AS
 SELECT g.geonameid, g.name AS name, g.country, NULL AS isolanguage, 
         NULL AS ispreferredname
         FROM geoname.geonames AS g 
         WHERE g.fclass = 'P' OR
         g.fcode = 'PPL' OR
         g.fcode = 'PPLA'
 UNION
 SELECT g.geonameid, a.alternatename AS name, g.country, 
         a.isolanguage, a.ispreferredname
         FROM geoname.geonames AS g INNER JOIN geoname.alternatename AS a 
         ON g.geonameid = a.geonameid
         WHERE g.fclass = 'P' OR
         g.fcode = 'PPL' OR
         g.fcode = 'PPLA';
 


But there are also wrong entries.
For example:
SELECT DISTINCT geonameid FROM cities WHERE name = 'München' 


results:
2867711
2867712
2867713
2867714
3070456

Anyone any ideas?

Thanks
Andreas
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline

Why do you think this is wrong? There is more than one city with the name "München".

Marc

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team