Revision 9930
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/vegbien.sql | ||
---|---|---|
4196 | 4196 |
-- |
4197 | 4197 |
|
4198 | 4198 |
CREATE VIEW taxon_trait_view AS |
4199 |
SELECT COALESCE(taxonverbatim.taxonname, taxonverbatim.taxonomicname, taxonlabel.taxonomicname) AS "scientificName", trait.name AS "measurementType", trait.value AS "measurementValue", trait.units AS "measurementUnit" FROM ((((trait LEFT JOIN taxonoccurrence USING (taxonoccurrence_id)) LEFT JOIN taxondetermination ON (((taxondetermination.taxonoccurrence_id = taxonoccurrence.taxonoccurrence_id) AND taxondetermination.iscurrent))) LEFT JOIN taxonverbatim USING (taxonverbatim_id)) LEFT JOIN taxonlabel USING (taxonlabel_id));
|
|
4199 |
SELECT COALESCE("ScrubbedTaxon"."acceptedTaxonName", "ScrubbedTaxon"."matchedTaxonName", taxonverbatim.taxonname, taxonverbatim.taxonomicname, taxonlabel.taxonomicname) AS "scientificName", trait.name AS "measurementType", trait.value AS "measurementValue", trait.units AS "measurementUnit" FROM (((((trait LEFT JOIN taxonoccurrence USING (taxonoccurrence_id)) LEFT JOIN taxondetermination ON (((taxondetermination.taxonoccurrence_id = taxonoccurrence.taxonoccurrence_id) AND taxondetermination.iscurrent))) LEFT JOIN taxonverbatim USING (taxonverbatim_id)) LEFT JOIN taxonlabel USING (taxonlabel_id)) LEFT JOIN "TNRS"."ScrubbedTaxon" ON (("ScrubbedTaxon"."concatenatedScientificName" = taxonlabel.taxonomicname)));
|
|
4200 | 4200 |
|
4201 | 4201 |
|
4202 | 4202 |
-- |
Also available in: Unified diff
bugfix: schemas/vegbien.sql: taxon_trait_view: use the TNRS-scrubbed name from ScrubbedTaxon when available