添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

if else logic in select statement

Sandy0594 Aug 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,
                WHEN deptno = 10
                   THEN sal * 0.05
                WHEN deptno = 20
                   THEN sal * 0.10
             END AS new_sal
        FROM emp;
Thanks in advance!!
Jump to Answer