Project

General

Profile

« Previous | Next » 

Revision 7851

schemas/vegbien.sql: tnrs_input_name: accepted_name subquery: Use new MatchedTaxon, AcceptedTaxon views, which use VegCore column names where possible

View differences:

schemas/vegbien.sql
4628 4628
--
4629 4629

  
4630 4630
CREATE VIEW tnrs_input_name AS
4631
    WITH accepted_name AS (SELECT DISTINCT tnrs."Accepted_scientific_name" AS taxonomicname FROM ("TNRS".tnrs LEFT JOIN "TNRS".tnrs tnrs_accepted ON ((tnrs_accepted."Name_submitted" = tnrs."Accepted_scientific_name"))) WHERE ((tnrs."Accepted_scientific_name" IS NOT NULL) AND (tnrs_accepted."Name_submitted" IS NULL))) SELECT accepted_name.taxonomicname FROM accepted_name UNION ALL (SELECT DISTINCT taxonlabel.taxonomicname FROM (taxonlabel LEFT JOIN "TNRS".tnrs ON ((tnrs."Name_submitted" = taxonlabel.taxonomicname))) WHERE (((taxonlabel.taxonomicname IS NOT NULL) AND (taxonlabel.matched_label_id IS NULL)) AND (tnrs."Name_submitted" IS NULL)) EXCEPT SELECT accepted_name.taxonomicname FROM accepted_name);
4631
    WITH accepted_name AS (SELECT DISTINCT "MatchedTaxon"."acceptedScientificName" AS taxonomicname FROM ("TNRS"."MatchedTaxon" LEFT JOIN "TNRS"."AcceptedTaxon" ON (("AcceptedTaxon"."acceptedScientificName" = "MatchedTaxon"."acceptedScientificName"))) WHERE (("MatchedTaxon"."acceptedScientificName" IS NOT NULL) AND ("AcceptedTaxon"."acceptedScientificName" IS NULL))) SELECT accepted_name.taxonomicname FROM accepted_name UNION ALL (SELECT DISTINCT taxonlabel.taxonomicname FROM (taxonlabel LEFT JOIN "TNRS".tnrs ON ((tnrs."Name_submitted" = taxonlabel.taxonomicname))) WHERE (((taxonlabel.taxonomicname IS NOT NULL) AND (taxonlabel.matched_label_id IS NULL)) AND (tnrs."Name_submitted" IS NULL)) EXCEPT SELECT accepted_name.taxonomicname FROM accepted_name);
4632 4632

  
4633 4633

  
4634 4634
--

Also available in: Unified diff