Project

General

Profile

« Previous | Next » 

Revision 7352

schemas/vegbien.sql: taxon_trait_view: Join only on the primary taxonlabel, not the accepted taxonlabel, because the scrubbed name is now available directly via the taxonlabel attached to the scrubbed taxondetermination

View differences:

schemas/vegbien.sql
4173 4173
--
4174 4174

  
4175 4175
CREATE VIEW taxon_trait_view AS
4176
    SELECT accepted_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 USING (taxonoccurrence_id)) LEFT JOIN taxonverbatim datasource_taxonverbatim USING (taxonverbatim_id)) LEFT JOIN taxonlabel datasource_taxonlabel USING (taxonlabel_id)) LEFT JOIN taxonlabel accepted_taxonlabel ON ((accepted_taxonlabel.taxonlabel_id = datasource_taxonlabel.canon_label_id))) WHERE COALESCE(taxondetermination.iscurrent, true);
4176
    SELECT 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 USING (taxonoccurrence_id)) LEFT JOIN taxonverbatim datasource_taxonverbatim USING (taxonverbatim_id)) LEFT JOIN taxonlabel USING (taxonlabel_id)) WHERE COALESCE(taxondetermination.iscurrent, true);
4177 4177

  
4178 4178

  
4179 4179
--

Also available in: Unified diff