GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Retrieving correct translations from `alternatename`  XML
Forum Index -> FAQ - frequently asked questions
Author Message
uzbbert



Joined: 18/10/2016 11:04:10
Messages: 2
Offline

I'm having trouble creating a query that matches a geonameid to a single record in the `alternatename` table. Basically when I retrieve a "DE" translation for some entity, I want my SQL join to only return 1 match.

However, the fields `alternatename.isShortName` and `alternatename.isPreferredName` does not seem to be properly filled out. I get multiple matches per geonameid on my query, but i would like to have the following situation (returning the first record that matches the criteria):

if isPreferredName=1, then use it.
else if isShortName=1, then use that.
else, use whatever match we can find for that language code.

Any clue on how to build this query while still allowing it to be performant on a large dataset?
uzbbert



Joined: 18/10/2016 11:04:10
Messages: 2
Offline

it took 2 days for this post to get through the moderation. I've since found an answer. I'm not going to post it until this forum opens up the doors
 
Forum Index -> FAQ - frequently asked questions
Go to:   
Powered by JForum 2.1.5 © JForum Team