[CHECK] Check if all original source names of occurrences are correctly imported
For Bellis perennis var. hybrida this is currently not the case (see distribution for Bellis perennis in Sicily (ref: Giardina, G., Raimondo, F. M. & Spadaro, V.: A catalogue of plants growing in Sicily Bocconea 20. 2008, 70220)
SELECT s.*, n.* FROM emOccurrenceSource s INNER JOIN Name n ON s.OldNameFk = n.NameID WHERE s.OldName = 'Bellis perennis var. hybrida' AND SourceNumber = '70220' OR s.OldNameFk = 117931
Updated by Andreas Müller almost 4 years ago
It looks like this is correct now. However, there were >3500 duplicates in emOccurrenceSource with same OccFk, SourceNumber and 1 side has no oldName and no oldNameFk.
I deleted them all
Potential candidates (uncomment for stricter rules)
SELECT os1.*, os2.OccurrenceSourceId, os2.OccurrenceFk, os2.Source, os2.OldName, os2.OldNameFk, os2.PreferredReferenceFlag FROM emOccurrenceSource os1 INNER JOIN emOccurrenceSource os2 ON os1.OccurrenceFk = os2.OccurrenceFk AND os1.SourceNumber = os2.SourceNumber -- AND (os1.Source=os2.Source OR os1.Source IS NULL AND os2.Source IS NULL) AND os1.OccurrenceSourceId <> os2.OccurrenceSourceId AND (os1.OldName IS NULL AND os1.OldNameFK IS NULL ) -- AND os1.PreferredReferenceFlag IS NULL ORDER BY os1.SourceNumber