现在的位置: 首页 > 综合 > 正文

如果要求工资在5000以下的工资加到2倍,5000到10000之间1.5倍,10000-15000之间加到1.2倍,15000以上的1.1倍

2012年09月27日 ⁄ 综合 ⁄ 共 561字 ⁄ 字号 评论关闭
--如果要求工资在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;

抱歉!评论已关闭.