number of errors=0
number of warnings=0
Group=chkGrpHierarchy
select p.geonameid,p.name,p.featurecode,p.cc2,c.geonameid,c.name,c.featurecode,c.countrycode from geoname p, geoname c, geoname_hierarchy h where c.geonameid=childid and p.geonameid=parentid and p.featurecode<>'PCLI' and c.featureclass='A' and c.featurecode like 'PCL%' and c.featurecode <>'PCLH' and coalesce(p.cc2,'') not like '%' || c.countrycode || '%'
select string_agg(countrycode,',') from (select distinct b.countrycode from geoname a, geoname b, geoname_hierarchy where a.geonameid=parentid and b.geonameid=childid and a.geonameid=xxxxxxx order by 1) as s;
geonameid name featurecode cc2 geonameid name featurecode countrycode