humlab-sead / sead_bugs_import

SEAD bugs import
2 stars 0 forks source link

Bugs ecocode data has duplicates in taxa. #17

Closed roger-mahler closed 5 years ago

roger-mahler commented 5 years ago

Shouldn't taxon be unique within an ecocode system? This query run on 2017, 2018 and 2019 imports gives different counts for total number of ecocodes and distinct taxon_id.

SELECT count(*), count(distinct e.taxon_id)
FROM tbl_ecocodes e
JOIN tbl_ecocode_definitions ed USING (ecocode_definition_id)
JOIN tbl_ecocode_groups eg USING (ecocode_group_id)
WHERE ecocode_system_id = 2;
roger-mahler commented 5 years ago

Closing issue since this is by design.