forked from gbif/model-material
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create luxembourbasic-specimen-data.sql
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
select | ||
SU."Collection_Unit_Key" , | ||
SU."Parent_Collection_Collection_Unit_Key" , | ||
C."Item_Name" as colelctionName , | ||
CON."Published_Term" as specimenType , | ||
CUN."Number" as catalogueNumber, | ||
CUN1."Number" as otherCatalogueNumber | ||
from foreign_all."Specimen_Unit" SU | ||
join foreign_all."Collection" C on SU."Parent_Collection_Collection_Unit_Key" = C."Collection_Unit_Key" | ||
join foreign_all."Collection_Unit_Number" CUN on SU."Collection_Unit_Key" = CUN."Collection_Unit_Key" and CUN."Preferred" ='1' | ||
left join foreign_all."Collection_Unit_Number" CUN1 on SU."Collection_Unit_Key" = CUN1."Collection_Unit_Key" and CUN."Preferred" ='0' | ||
join foreign_all."Concept" CON on SU."Specimen_Type_Concept_Key" = CON."Concept_Key" | ||
where SU."Parent_Collection_Collection_Unit_Key" = 'DSS0043900001VPF' -- specimens from a specific collection | ||
; | ||
|