oracle 函数sign()、ABS()、decode()、case when、
2011-09-08 16:38
483 查看
sign()函数:取数字n的符号,大于0返回1,小于0返回-1,等于0返回0
e.g.select sign( 100 ),sign(-
100 ),sign( 0 ) from dual;
1.SIGN(123 ) SIGN(- 100 ) SIGN( 0 )
2.--------- ---------- ---------
3. 1 - 1 0
e.g.select sign( 100 ),sign(-
100 ),sign( 0 ) from dual;
1.SIGN(123 ) SIGN(- 100 ) SIGN( 0 )
2.--------- ---------- ---------
3. 1 - 1 0
绝对值 ABS() SQL> SELECT ABS(-7), ABS(7) FROM DUAL; ABS(-7) ABS(7) ---------- ---------- 7 7
select a.*,decode(sign(a.房租-b.房租),1,'奢侈','普通') from 表名 a, (select 城市,avg(房租) 房租 from 表名 group by 城市) b where a.城市=b.城市 select decode(sign(sal-2000),-1,'普通',0,'正常','奢侈'),sal from emp;
case when.. update personal set salary= case when salary>=5000 then salary*0.9 when salary>=2000 and salary<4600 then salary*1.15 else salary end;
相关文章推荐
- oracle (decode,case when ...then...else...end,sign)函数介绍
- oracle中的nvl 、nvl2、decode、case when 函数的用法
- oracle 中的 decode()、nvl()、sign()函数详解
- oracle里面如何写case语句及decode and sign 函数用法
- oracle里面如何写case语句及decode and sign 函数用法
- oracle的decode()函数,sign()函数
- oracle中的计算函数decode和case when
- Oracle 中 sign和decode 函数用法
- 好用的函数sign和decode
- Oracle中Decode()函数使用技巧
- oracle笔记整理7——with as、case when、merge into、分析函数over()
- oracle中decode()和nvl()函数的用法
- oracle decode(e,s1,t1[,s2,t2]...default)函数
- oracle中 decode()函数简介
- Oracle 中 decode 函数用法
- oracle 函数 to_char、round、decode之二 round
- 好用的函数sign和decode
- Oracle函数Decode
- 解析:怎样使用Oracle的DECODE()函数
- Oracle中Decode()函数使用技巧