Project

General

Profile

« Previous | Next » 

Revision 11636

schemas/vegbien.sql: taxon_trait_view: updated to use new taxon_scrub

View differences:

schemas/vegbien.sql
4460 4460
--
4461 4461

  
4462 4462
CREATE VIEW taxon_trait_view AS
4463
    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)));
4463
    SELECT COALESCE(taxon_scrub.scrubbed_taxon_name_no_author, 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".taxon_scrub ON ((taxon_scrub."concatenatedScientificName" = taxonlabel.taxonomicname)));
4464 4464

  
4465 4465

  
4466 4466
--

Also available in: Unified diff