forked from AndyMoreland/squiggle-sql
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Do you support UNION and LEFT OUTER JOIN ON as well?
We are working with SAP HANA.
We have quite complex SQLs to create views driven by a config file. See here an example.
select a1.subject_uuid, a2.DT, measure_type, measure_value, measure_unit from
(select distinct subject_uuid from clinical_audit_record where item_oid = 'VS_H_SCN.WEIGHT') as a1
left outer join
(select subject_uuid, item_value as DT
from clinical_audit_record where item_oid = 'VS_H_SCN.VS_DT' and audit_subcategory_name = 'Entered') as a2
on a1.subject_uuid = a2.subject_uuid
left outer join
(select subject_uuid, 'VS_H_SCN.WEIGHT' measure_type, item_value as measure_value
from clinical_audit_record where item_oid = 'VS_H_SCN.WEIGHT' and audit_subcategory_name = 'Entered') as a3
on a1.subject_uuid = a3.subject_uuid
left outer join
(select subject_uuid, item_value as measure_unit
from clinical_audit_record where item_oid = 'VS_H_SCN.WEIGHT_UNIT' and audit_subcategory_name = 'Entered') as a4
on a1.subject_uuid = a4.subject_uuid
union all
select a1.subject_uuid, a2.DT, measure_type, measure_value, measure_unit from
(select distinct subject_uuid from clinical_audit_record where item_oid = 'VS_H_SCN.SYSBP') as a1
left outer join
(select subject_uuid, item_value as DT
from clinical_audit_record where item_oid = 'VS_H_SCN.VS_DT' and audit_subcategory_name = 'Entered') as a2
on a1.subject_uuid = a2.subject_uuid
left outer join
(select subject_uuid, 'VS_H_SCN.SYSBP' measure_type, item_value as measure_value, 'mmHg' measure_unit
from clinical_audit_record where item_oid = 'VS_H_SCN.SYSBP' and audit_subcategory_name = 'Entered') as a3
on a1.subject_uuid = a3.subject_uuidReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels