1
Invantive SQL是否支持單個case語句中的多個條件?我在下面的聲明中,我沒有得到任何結果。只用1個條件(沒有級聯)嘗試相同的語句,這檢索了預期的結果。在單例語句中結合多個條件
select prj.code
, prj.startdate
, prj.enddate
from exactonlinerest..projects prj
where prj.code between $P{P_PROJECT_FROM} and $P{P_PROJECT_TO}
and case
/* when (prj.enddate is null or prj.enddate >= sysdate)
then 'Y'
when (prj.enddate is not null and prj.enddate <= sysdate)
then 'N' */
when prj.startdate <= sysdate
then 'B'
end
= $P{P_PROJECT_ACTIVE_FROM}