Revision 1595
Added by Aaron Marcuse-Kubitza almost 13 years ago
mappings/verify.specimens.sql | ||
---|---|---|
40 | 40 |
FROM specimenreplicate |
41 | 41 |
JOIN taxondetermination USING (taxonoccurrence_id) |
42 | 42 |
JOIN plantconcept USING (plantconcept_id) |
43 |
JOIN plantname_ancestor USING (plantname_id) |
|
43 |
JOIN plantname_ancestor AS genus_ancestor |
|
44 |
ON genus_ancestor.plantname_id = plantconcept.plantname_id |
|
44 | 45 |
JOIN plantname AS genus_plantname |
45 |
ON genus_plantname.plantname_id = plantname_ancestor.ancestor_id
|
|
46 |
ON genus_plantname.plantname_id = genus_ancestor.ancestor_id
|
|
46 | 47 |
AND genus_plantname.rank = 'genus' |
48 |
JOIN plantname_ancestor AS species_ancestor |
|
49 |
ON species_ancestor.plantname_id = plantconcept.plantname_id |
|
47 | 50 |
JOIN plantname AS species_plantname |
48 |
ON species_plantname.plantname_id = plantname_ancestor.ancestor_id
|
|
51 |
ON species_plantname.plantname_id = species_ancestor.ancestor_id
|
|
49 | 52 |
AND species_plantname.rank = 'species' |
50 | 53 |
WHERE datasource_id = |
51 | 54 |
(SELECT party_id FROM party WHERE organizationname = :datasource) |
Also available in: Unified diff
mappings/verify.specimens.sql: # species: Fixed to join separately on plantname_ancestor for genus and species