number of errors=70
number of warnings=0
select countrycode,name,iso_3166_2,fips,geonamesadmcode,capitalid from countrysubdivision where not exists (select 1 from geoname where capitalid=geonameid and featureclass='P' and(admincode1=geonamesadmcode or admincode2=geonamesadmcode or admincode3=geonamesadmcode)) and capitalid is not null and validtill is null order by countrycode,name
countrycode name iso_3166_2 fips geonamesadmcode capitalid AZ Lankaran Sahari LA 30 30 147622 AZ Naxçivan NV 75 75 147429 AZ Susa Sahari null 56 56 147105 BS Harbour Island HI 22 22 3571375 BT Trashigang 41 19 19 1252422 BW North East NE 08 08 933778 BW South East SE 09 09 933773 BY Horad Minsk HM 04 04 625665 BY Minsk voblast MI 05 05 625144 CG Kouilou 5 04 04 2255414 CI Lagunes LG 82 82 2293538 CO Cundinamarca CUN 33 33 3688689 CZ Praha 1 101 null 8378769 3067696 FI Etelä-Savo [Finnish] / Södra Savolax [Swedish] 04 19 10 641056 FI Keski-Suomi [Finnish] / Mellersta Finland [Swedish] 08 24 13 658225 FI Pirkanmaa [Finnish] / Birkaland [Swedish] 11 28 06 638936 GB Monmouthshire MON Y4 Y4 2651654 HK Kowloon City Kowloon KKC null KKC 1819609 HU Debrecen DE 07 07 721472 HU Gyor GY 25 25 3052009 HU Miskolc MI 13 13 717582 HU Pecs PS 15 15 3046526 HU Szeged SD 19 19 715429 IN Andhra Pradesh AP 02 02 1269843 IN Goa GA 33 33 1269655 JM Saint Andrew Parish 02 08 08 3489854 KH Banteay Mean Choay 1 25 25 1821306 KH Otdar Mean Choay 22 27 27 1822331 KP P'yongan-bukto 03 11 11 1871871 KZ Almaty 19 01 01 1518542 KZ Ongtustik Qazaqstan 61 10 10 1518980 LA Vientiane VT 24 24 1655124 LA Vientiane VI 27 27 1651944 LU Canton d'Esch-sur-Alzette ES 08 ES 2960276 LV Jelgavas Novads 041 76 12 459279 LV Rēzeknes Novads 077 B2 24 456202 LV Valkas Novads 101 D8 30 455166 MA Laâyoune-Sakia El Hamra 11 65 11 2462881 MK Karpoš 808 41 41 785842 MK Saraj 811 90 90 786093 MT Tarxien 58 58 58 2562349 MT Ta Xbiex 59 59 59 2562320 MV Male MLE 40 40 1282027 MZ Maputo L 04 04 1040652 NO Akershus null null 01 3143244 OM Al Batinah South BJ 02 02 286282 PA Naso Tjër Di NT null NT 10211159 PE Lima LIM 15 15 3936456 PW Aimeliik 002 01 01 1559543 PY Boqueron 19 24 24 3438102 PY Central 11 06 06 3439389 RO Bucuresti B 10 10 685948 RU Moscow (Province) MOS 47 47 8505053 SB Guadalcanal GU 06 06 2108502 SC Anse aux Pins 01 01 01 241131 SC Grand' Anse (on Mahe) 13 24 24 241131 TD Tibesti TI 26 26 2432678 TH Pattaya S null S 1614295 TM Ahal Welayaty A 01 01 162183 TW Hsinchu HSQ 08 HSQ 1677112 TW Hsinchu HSZ 09 HSZ 1675151 TW Taipei null null 03 1668341 UA Kiev 32 13 13 703448 UG Bugiri 201 66 66 234565 UG Bulambuli 225 E9 E9 234306 UG Butambala 119 F1 F1 233382 UG Kyankwanzi 123 G1 G1 8051534 UG Pader 312 92 92 448227 VC Saint Patrick 05 05 05 3577879 YE San'a SN 16 16 71137