Project

General

Profile

« Previous | Next » 

Revision 7202

schemas/vegbien.sql: unscrubbed_taxondetermination_view: Fixed bug where need to handle the case where (SELECT source.source_id FROM source WHERE source.shortname = 'TNRS') is NULL because no TNRS names have been imported yet

View differences:

schemas/vegbien.sql
4542 4542
--
4543 4543

  
4544 4544
CREATE VIEW unscrubbed_taxondetermination_view AS
4545
    SELECT taxondetermination.taxonoccurrence_id, tnrs_canon."Time_submitted", tnrs_canon."Name_number", tnrs_canon."Name_submitted", tnrs_canon."Overall_score", tnrs_canon."Name_matched", tnrs_canon."Name_matched_rank", tnrs_canon."Name_score", tnrs_canon."Name_matched_author", tnrs_canon."Name_matched_url", tnrs_canon."Author_matched", tnrs_canon."Author_score", tnrs_canon."Family_matched", tnrs_canon."Family_score", tnrs_canon."Name_matched_accepted_family", tnrs_canon."Genus_matched", tnrs_canon."Genus_score", tnrs_canon."Specific_epithet_matched", tnrs_canon."Specific_epithet_score", tnrs_canon."Infraspecific_rank", tnrs_canon."Infraspecific_epithet_matched", tnrs_canon."Infraspecific_epithet_score", tnrs_canon."Infraspecific_rank_2", tnrs_canon."Infraspecific_epithet_2_matched", tnrs_canon."Infraspecific_epithet_2_score", tnrs_canon."Annotations", tnrs_canon."Unmatched_terms", tnrs_canon."Taxonomic_status", tnrs_canon."Selected", tnrs_canon."Source", tnrs_canon."Warnings" FROM (((taxondetermination JOIN taxonverbatim USING (taxonverbatim_id)) JOIN taxonlabel USING (taxonlabel_id)) JOIN "TNRS".tnrs_canon ON ((tnrs_canon."Name_submitted" = taxonlabel.taxonomicname))) WHERE (taxondetermination.iscurrent AND (taxondetermination.source_id <> (SELECT source.source_id FROM source WHERE (source.shortname = 'TNRS'::text)))) ORDER BY taxondetermination.taxonoccurrence_id;
4545
    SELECT taxondetermination.taxonoccurrence_id, tnrs_canon."Time_submitted", tnrs_canon."Name_number", tnrs_canon."Name_submitted", tnrs_canon."Overall_score", tnrs_canon."Name_matched", tnrs_canon."Name_matched_rank", tnrs_canon."Name_score", tnrs_canon."Name_matched_author", tnrs_canon."Name_matched_url", tnrs_canon."Author_matched", tnrs_canon."Author_score", tnrs_canon."Family_matched", tnrs_canon."Family_score", tnrs_canon."Name_matched_accepted_family", tnrs_canon."Genus_matched", tnrs_canon."Genus_score", tnrs_canon."Specific_epithet_matched", tnrs_canon."Specific_epithet_score", tnrs_canon."Infraspecific_rank", tnrs_canon."Infraspecific_epithet_matched", tnrs_canon."Infraspecific_epithet_score", tnrs_canon."Infraspecific_rank_2", tnrs_canon."Infraspecific_epithet_2_matched", tnrs_canon."Infraspecific_epithet_2_score", tnrs_canon."Annotations", tnrs_canon."Unmatched_terms", tnrs_canon."Taxonomic_status", tnrs_canon."Selected", tnrs_canon."Source", tnrs_canon."Warnings" FROM (((taxondetermination JOIN taxonverbatim USING (taxonverbatim_id)) JOIN taxonlabel USING (taxonlabel_id)) JOIN "TNRS".tnrs_canon ON ((tnrs_canon."Name_submitted" = taxonlabel.taxonomicname))) WHERE (taxondetermination.iscurrent AND (taxondetermination.source_id <> COALESCE((SELECT source.source_id FROM source WHERE (source.shortname = 'TNRS'::text)), 2147483647))) ORDER BY taxondetermination.taxonoccurrence_id;
4546 4546

  
4547 4547

  
4548 4548
--

Also available in: Unified diff