Revision 7367
Added by Aaron Marcuse-Kubitza almost 12 years ago
schemas/vegbien.sql | ||
---|---|---|
4175 | 4175 |
-- |
4176 | 4176 |
|
4177 | 4177 |
CREATE VIEW taxon_trait_view AS |
4178 |
SELECT COALESCE(taxonlabel.taxonomicname, taxonverbatim.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)); |
|
4178 |
SELECT COALESCE(taxonlabel.taxonomicname, taxonverbatim.taxonomicname, taxonverbatim.taxonname) 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));
|
|
4179 | 4179 |
|
4180 | 4180 |
|
4181 | 4181 |
-- |
Also available in: Unified diff
schemas/vegbien.sql: taxon_trait_view: scientificName: Use taxonverbatim.taxonname when taxonlabel/taxonverbatim.taxonomicname are not provided, to accommodate TNRS names. This is part of the workaround for the bug where the taxonlabel's taxonomicname (concatenated taxonomicname) is occasionally not populated.