if 0 <> (select count(*) from sung where hakbun = 1)then
cnt := cnt+1;
end if;
I tried to above source and Oracle shows blow error
PLS-00405: subquery not allowed in this context
What am i doing wrong?
if 0 <> (select count(*) from sung where hakbun = 1)then
cnt := cnt+1;
end if;
I tried to above source and Oracle shows blow error
PLS-00405: subquery not allowed in this context
What am i doing wrong?
How about doing the whole thing in a single query? Does this work?
select cnt + (case when count(*) > 0 then 1 else 0 end) into cnt
from sung
where hakbun = 1;