drop table if exists mergeList;

# create the mergeList
create table mergeList
select bioRecordKey as brKey
from syn_delta.bioRecord
left join syn_delta.cormList on resourceKey = bioRecordResourceKey
where european_data_only is true     /* resources with european_data_only */
   or bioRecordCountryCode in
      ('AL', 'AD', 'AT', 'BY', 'BE', 'BA', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE',
			 'GI', 'GR', 'HU', 'IS', 'IE', 'IL', 'IT', 'LV', 'LI', 'LT', 'LU', 'MK', 'MT', 'MD', 'MC',
			 'NL', 'NO', 'PL', 'PT', 'RO', 'RU', 'CS', 'SK', 'SI', 'ES', 'SE', 'CH', 'UA', 'GB', 'VA');

alter table mergeList
	add key (brKey);