--如果要求工资在5000以下的工资加到2倍,5000到10000之间1.5倍,10000-15000之间加到1.2倍,15000以上的1.1倍
with t as
    (select 5000 sal from dual union all
      select 4000 from dual union all
      select 6000 from dual union all
      select 10000 from dual union all
      select 14000 from dual union all
      select 15000 from dual union all
    select 20000 from dual)
 -- select sal,decode(-1,sign(sal-5000),sal*2,sign(sal-10000),sal*1.5,sign(sal-15000),sal*1.2,sal*1.1) new_sal
 select sal,case when sal<5000 then sal*2
                 when  sal<1000 then sal*1.5
                 when sal<1500 then  sal*1.2
                 else sal*1.1 end  new_sal
 from t;
posted on 2010-10-02 08:44  新小白龙  阅读(1270)  评论(0编辑  收藏  举报