Skip to content

Commit

Permalink
Create luxembourbasic-specimen-data.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
mnhn-paul authored Mar 1, 2023
1 parent 65a87ae commit db01fcb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions luxembourbasic-specimen-data.sql
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
;

0 comments on commit db01fcb

Please sign in to comment.