oracle decode函数 和 case when
2014-02-19 19:06
316 查看
1.oracle decode分支函数
相当于
2. case when then end case 也能完成这个操作
相当于
select decode(to_char(B.LQSJ, 'hh24:mi:ss'), '00:00:00', to_char(B.LQSJ, 'yyyy-mm-dd') || ' ' || '01:01:01', to_char(B.LQSJ, 'yyyy-mm-dd hh24:mi:ss')) from pcxx b
相当于
select decode('表达式', '如果A', '则A', '如果B', '则B', '其他')
2. case when then end case 也能完成这个操作
select case to_char(B.LQSJ, 'hh24:mi:ss') when '00:00:00' then to_char(B.LQSJ, 'yyyy-mm-dd') || ' ' || '01:01:01' else to_char(B.LQSJ, 'yyyy-mm-dd hh24:mi:ss') end case from pcxx b
相当于
select case'表达式' when 'A' then 'A1' when 'B' then 'B1' else end case
相关文章推荐
- oracle中if/else、decode函数、case when
- Oracle中decode函数对case when的简化
- Oracle DECODE函数的语法介绍
- oracle-decode函数
- 使用Oracle的Decode函数进行多值判断
- Oracle中DECODE函数的用法
- oracle中decode函数如何使用?
- oracle decode函数使用方法
- Oracle NVL和DECODE函数的漏洞
- Oracle中的逻辑判断(nvl、decode和case when)
- oracle 数据库 Decode函数
- oracle decode函数的使用
- oracle decode函数使用方法
- ORACLE的sign函数和DECODE函数
- CASE WHEN 语句在Oracle和Sybase库中的不同
- oracle查询语句中case when的使用
- Oracle Decode函数的用法
- Oracle-decode函数
- Oracle-Sql 语句中 Case When 的应用
- Oracle DECODE函数