Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

if else logic in select statement

DevguyAug 2 2011 — edited Aug 2 2011
Hi,
Can someone kindly explain me how can i use if-else logic in the place of case statement in the below query.
SELECT deptno, empno, ename, sal,
             CASE
                WHEN deptno = 10
                   THEN sal * 0.05
                WHEN deptno = 20
                   THEN sal * 0.10
             END AS new_sal
        FROM emp;
Thanks in advance!!
This post has been answered by 647939 on Aug 2 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 30 2011
Added on Aug 2 2011
15 comments
66,124 views