GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
MYSQL query list city and county for US State almost there  XML
Forum Index -> General
Author Message
beopace5



Joined: 08/06/2021 23:39:46
Messages: 1
Offline

I want help with this code. I am attempting to list city and county for all cities having population over 0 in the state of New York This code doesn't work. All my tables are named lowercase different than the norm for easy reading. I don't know why the code doesn't work. I get stuck on the CONCAT. Can you correct it.

SELECT DISTINCT geoname.name AS placename, admin2codes.name AS county FROM geoname INNER JOIN admin2codes ON CONCAT(geoname.country,'.',geoname.admin1,'.',geoname.admin2) = admin2codes.code WHERE geoname.admin = 'NY' AND geoname.population > 0 LIMIT 500
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team