how to fire sql query conditionally?
Hi all,
I want a select query to fire conditionally.
for example
I want this:
select case when &a>2 then
select 2 from dual
else when &a<2 then
select 3 from dual
end
from dual;
when variable a is greater than 2 then "select 2 from dual" query will fire
and when variable a is less than 2 the "select 3 from dual " query will fire.
how to do this?