テーブル ColA ColB ---- ---- 10 10 10 20 10 null 20 10 20 20 20 null null 10 null 20 null null 以下の二つの条件の真偽を求めます。 (ColA < 15 and ColB < 15) is not true (ColA < 15 and ColB < 15) is not false 出力結果 ColA ColB is not true is not false ---- ---- ----------- ------------ 10 10 0 1 10 20 1 0 10 null 1 1 20 10 1 0 20 20 1 0 20 null 1 0 null 10 1 1 null 20 1 0 null null 1 1
select ColA,ColB, case when ColA < 15 and ColB < 15 then 0 else 1 end as "is not true", case when not (ColA < 15 and ColB < 15) then 0 else 1 end as "is not false" from (select 10 as ColA,10 as ColB from dual union select 10, 20 from dual union select 10,null from dual union select 20, 10 from dual union select 20, 20 from dual union select 20,null from dual union select null, 10 from dual union select null, 20 from dual union select null,null from dual);
case式でis not trueとis not falseを模倣することができます。 場合によっては、lnnvl述語を使ってもいいでしょう。 2-2-11 case式とLNNVL述語 8-2 case式でis not falseを模倣