Changes

Country structure orphans

390 bytes added, 13:31, 2 June 2017
no edit summary
gazetteer.parentgazetteer_guid IS NULL AND
gazetteerlevel.seqno <> '1'
</pre>
 
This query checks if the child is parent to itself
<pre>
SELECT
gazetteer.gazetteer_guid,
gazetteer.parentgazetteer_guid,
gazetteer.gazetteer_localid,
gazetteer.gazetteername,
gazetteerlevel.seqno,
gazetteerlevel.level
FROM
gazetteer
Inner Join gazetteerlevel ON gazetteer.gazlevel_guid = gazetteerlevel.gazlevel_guid
where
gazetteer.gazetteer_guid = gazetteer.parentgazetteer_guid
</pre>
6,632
edits