Oracle case 关键字的使用

select e.salary,
--case 语句开始
       case
         when salary between 12000 and 15000 then
          salary + 6000
         else
          salary
       end new_salary
--case 语句结束,可见也和存储过程等结束方式一样用end关键字,且这个case语句的作用只是用来计算一个新的列
  from t_employee e;

 

输出结果如下:

posted @ 2013-09-28 15:39  jmStatham  阅读(375)  评论(0编辑  收藏  举报