<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Data consistency question-what am i doing wrong?"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "Data consistency question-what am i doing wrong?"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Data consistency question-what am i doing wrong?</title>
				<description><![CDATA[ Hi

We are in the process of using the allCountries data (in a SQL database).  As part of this process we are going through the process of extracting out the admin names to be displayed against each place that has people living there.

Now as i understand it if i start at a particular location then if the specific adminXcode is populated with a non 00 value then i should be able to lookup the name for that by querying the allCountries table looking for a  feature code of admX with the appropriate adminXcode populated.

I started of by trying the location where i live (GeoId 2639925) and this has an admin2Code of C5 - but this gives me a place on a different continent when i query the allcountries table for admin level 2 and a code of C5

I have since tried a simple query against the UK looking for records whereby the admin2Code is populated with a non 00 value but doesn't have a corresponding record in the same table for admn2.  THis returns 1000's of records. Query at bottom of post.

Am i doing something wrong or should i be taking a different approach?


Thank in advance


Jamie

select top 1000 * from allCountries ac 
where ac.admin2code <> '' AND ac.admin2code <> '00' and NOT EXISTS (SELECT * FROM allCountries AC2 WHERE AC2.featurecode='ADM2' AND AC2.admin2code=ac.admin2code)
AND ac.countrycode='GB'



]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/2170.page#8804</guid>
				<link>http://forum.geonames.org/gforum/posts/list/2170.page#8804</link>
				<pubDate><![CDATA[Thu, 2 Dec 2010 14:58:23]]> GMT</pubDate>
				<author><![CDATA[ jcmm33]]></author>
			</item>
			<item>
				<title>Re:Data consistency question-what am i doing wrong?</title>
				<description><![CDATA[ Hi

The codes are not global you will need to lookup the code the respective country.

C5 refers to the abolished county of Cheshire that has been split. The new code after the split has not yet been updated for all toponyms.

http://en.wikipedia.org/wiki/2009_structural_changes_to_local_government_in_England]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/2170.page#8806</guid>
				<link>http://forum.geonames.org/gforum/posts/list/2170.page#8806</link>
				<pubDate><![CDATA[Fri, 3 Dec 2010 08:17:01]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
	</channel>
</rss>