#■■■case式■■■
select
case when exists(select 1 from dual where 1=2) then (select 2)
when (select count(*)) > 10 then (select 3)
when (1,2) in(select 1,3 union select 3,2) then 4
when (select 5) = (select 6) then (select 7)
when (select 8) between (select 9) and (select 10) then (select 11)
when (select 'abc') Like (select 'a*d') then (select 12)
else (select 13) + (select 14) end as Val1,
15,16;
#■■■ifnull関数■■■
select ifnull(null,50),ifnull(2,50);
#■■■coalesce関数■■■
select coalesce(null,50,60),coalesce(2,50,60);
#■■■sign関数■■■
select sign(3),sign(0),sign(-10);
#■■■nullif関数■■■
select nullif(3,3),nullif(5,4);
#■■■greatest関数■■■
select greatest(1,10);
#■■■Least関数■■■
select Least(1,10);
#■■■abs関数とcase式■■■
select case when abs((select 6)) > 5 then 1 else 2 end;