if sal = 5000 then
salary := sal*3
end if;
if sal > 5000 then
salary := sal*2
end if;
if sal < 5000 then
salary := sal*4
end if;
The above IF condition I want to convert in DECODE the reason why I need it to be in DECODE, Because I am writing SQL report so I can not use IF condition in SQL. There are 3 diferent. formulas I have to use.
------------------------------
just for your ref.
SELECT
ename,
deptno,
hiredate,
DECODE(sal,5000,sal*3) salary
FROM emp;
How to check for > and < sal in DECODE or there is another way to handle this problem???
---------------------------------------
