GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Looking up city?  XML
Forum Index -> General
Author Message
ajmas



Joined: 09/02/2009 01:01:21
Messages: 18
Offline

I am wanting to be able to lookup a city in the database and then display the associated information on the place. I tried the following:

Code:
 select name,fcode,admin1 from geoname where name like '%Quebec%' and country = 'ca' and fcode = 'p.ppl'
 


but this did not return any results. Am I doing something wrong?
ajmas



Joined: 09/02/2009 01:01:21
Messages: 18
Offline

Never mind, found the answer. Looks like I didn't consider accents. This works:

Code:
select ge.* from geoname as ge, alternatename as al where al.alternateName like '%Quebec%' and ge.country = 'ca' and ge.geonameid = al.geonameid and ge.fcode = 'PPLA' group by ge.geonameid
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team