相关文章推荐

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
 
推荐文章