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