一个案例陈述可能有两个条件吗?
我需要以下声明的帮助,找不到任何可以帮助我获得理想结果的内容。我正试图让case
拥有VERIFICATION_TYPE
包括NULL
和Data entry 2
。
SELECT 'Data entry 2 not completed' label,
sum(case when VERIFICATION_TYPE = 'Data entry 2' then 1 else 0 end,
case when VERIFICATION_TYPE is null then 1 else 0) Value
from CR_MDT c
full join
(select v.*,
row_number() over (partition by v.FK_CR_MDT_ID order by v.CREATED desc) as rn
from CR_MDT_VERIFY v) d
ON (c.CR_MDT_ID = d.FK_CR_MDT_ID AND d.rn = 1),
PT_STUDY a,
PATIENT b
where b.SOCRD_ID=a.FK_SOCRD_ID
and b.SOCRD_ID=c.FK_SOCRD_ID
and PT_STUDY=3
and C.CR_MDT_DT between TO_DATE('01/01/2017', 'mm/dd/yyyy') and TO_DATE
('12/31/2017', 'mm/dd/yyyy')