Oracle 中 decode 函数用法
来源:互联网 发布:车辆参数修改软件 编辑:程序博客网 时间:2024/05/14 05:50
含义解释:
decode(条件,值1,返回值1,值2,返回值2,...值n,返回值n,缺省值)
该函数的含义如下:
IF 条件=值1 THEN
RETURN(翻译值1)
ELSIF 条件=值2 THEN
RETURN(翻译值2)
......
ELSIF 条件=值n THEN
RETURN(翻译值n)
ELSE
RETURN(缺省值)
END IF
decode(字段或字段的运算,值1,值2,值3)
这个函数运行的结果是,当字段或字段的运算的值等于值1时,该函数返回值2,否则返回值3
当然值1,值2,值3也可以是表达式,这个函数使得某些sql语句简单了许多
例如:
selectdecode(TEST_RESULT,null,'N/A','<a target = "_blank" href="'||REPORT_URL||'">Test Result</a>') as "Result"from TestTablewhere Test_ID=123456当Test_Result为空时返回N/A,否则返回Result URL。
- Oracle中decode函数用法
- Oracle 中 decode 函数用法
- oracle中decode函数用法
- Oracle中decode函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- Oracle 中 decode 函数用法
- MQ系统管理编程概述
- 助你成为百万富翁的10句箴言
- 黑马程序员_学习记录01:Hello Java
- Windows 8系统关机的十个方法!推荐收藏!
- 快速排序
- Oracle 中 decode 函数用法
- [循环节一水] hdu 4350 card
- HDU 4350 card
- 链表形式的josephus问题
- 上机题,检测电话号码
- CSDN的反网络化
- SSO单点登录解决方案[转载]
- HDU 3415 Max Sum of Max-K-sub-sequence(单调队列)
- 创业者须规避的六大误区