Oracle-decode函数
decode函数
简单例子:管理员登录Oracle
select sid,
       username,
       decode(command,
              0,
              'None',
              2,
              'Insert',
              3,
              'Select',
              6,
              'Update',
              7,
              'Delete',
              8,
              'Drop',
              'Other') command
  from v$session
 where username is not null;
语法结构:
decode(expression,search_1,result_1);
decode(expression,search_1,result_1,search_2,result_2);
decode(expression,search_1,result_1,search_2,result_2,… … search_n,result_n);
decode(expression,search_1,result_1,default);
decode(expression,search_1,result_1,search_2,result_2,default);
decode(expression,search_1,result_1,search_2,result_2,… … search_n,result_n,default);
decode(条件,值1,翻译值1,值2,翻译值2,… …值n,翻译值n);
decode(条件,值1,翻译值1,值2,翻译值2,… …值n,翻译值n,缺省值);
Oracle-decode函数的更多相关文章
- Oracle DECODE函数的语法介绍
		
Oracle DECODE函数功能很强,下面就为您详细介绍Oracle DECODE函数的用法,希望可以让您对Oracle DECODE函数有更多的了解. Oracle DECODE函数 Oracle ...
 - Oracle DECODE函数的用法详解
		
Oracle DECODE函数使用方法: 1.比较大小select decode(sign(变量1-变量2),-1,变量1,变量2) from dual; --取较小值sign()函数根据某个值是0. ...
 - Mysql-通过case..when实现oracle decode()函数进行多值多结果判断
		
oracle的decode函数使用:http://www.cnblogs.com/hwaggLee/p/5335967.html case ..when 函数使用:http://www.cnblogs ...
 - oracle decode函数用法
		
DECODE函数是ORACLE PL/SQL是功能强大的函数之中的一个,眼下还仅仅有ORACLE公司的SQL提供了此函数,其它数据库厂商的SQL实现还没有此功能.DECODE有什么用途 呢? 先构造一 ...
 - oracle decode()函数的参数原来可以为sql语句!
		
1.情景展示 判断某个字段的值,如果以APP开头,需查询APP表里对应的数据:如果是以JG开头,就查询机构对应的表. 2.原因分析 如果使用CASE WHEN THEN或者IF ELSIF 太麻烦 ...
 - oracle decode函数 和 case when
		
1.oracle decode分支函数 select decode(to_char(B.LQSJ, 'hh24:mi:ss'), '00:00:00', to_char(B.LQSJ, 'yyyy-m ...
 - Oracle decode()函数应用
		
在项目第一次遇到decode()函数,简单写一下用法. ')), ')), ')), ')), ')), ')), ')) from wg_jzmb jz, wg_jzfz fz where jz.s ...
 - Oracle decode函数  除数为零
		
decode (expression, search_1, result_1)如果 expression结果=search_1结果,则返回result_1,类似 if elsedecode (expr ...
 - [Oracle] decode 函数及其用法
		
http://blog.csdn.net/oscar999/article/details/18399177 前言 DECODE()函数,它将输入数值与函数中的参数列表相比较,根据输入值返回一个对应值 ...
 - oracle decode函数和 sign函数
		
流程控制函数 DECODE decode()函数简介: 主要作用: 将查询结果翻译成其他值(即以其他形式表现出来,以下举例说明): 使用方法: Select decode(columnname,值1, ...
 
随机推荐
- C语言学习笔记 -冒泡排序
			
//冒泡排序 void main(){ , , , , }; ]); ; i<max - ; i++) { for (int j = i; j<max; j++) { if (a[i]&g ...
 - jq hover方法用法 例子
			
<script type="text/javascript"> $(function(){ $('.caseslist').hover(functi ...
 - c#部分---一维数组、冒泡排序、foreach的用法
			
一维数组:2016-10-14 定义方式:{定义的时候,需要数据类型.长度!} 1.int []aa=new int [5]; 表示数组里面有5个字符: 2.int []aa=new int []{ ...
 - windows7下python3.4.3 添加库路径(转)
			
1, 动态的添加库路径.在程序运行过程中修改sys.path的值,添加自己的库路径import syssys.path.append(r'your_path') 2, 在Python安装目录下的\Li ...
 - php使用redis存储
			
一.Redis扩展模块 # wget https://codeload.github.com/phpredis/phpredis/zip/develop -O phpredis.zip # unzip ...
 - Codeforces Round #143 (Div. 2)
			
A. Team 模拟. B. Magic, Wizardry and Wonders 可以发现\[d=a_1-a_2+a_3-a_4+\cdots\] 那么有\(odd=\lfloor \frac{n ...
 - RecyclerView使用完全解析
			
http://blog.csdn.net/a396901990/article/details/40153759 Android RecyclerView 使用完全解析 体验艺术般的控件 通过这个控件 ...
 - 机器学习&人工智能书籍
			
Introduction to Machine Learning https://www.amazon.cn/Introduction-to-Machine-Learning-Alpaydin-Eth ...
 - ubuntu下如何安装wxpython
			
1.运行时缺失wx库,如何安装 Error:ImportError: No module named wx 解决方法:sudo apt-get install python-wxgtk2.8 pyth ...
 - Agent admitted failure to sign using the key
			
SSH生成id_rsa, id_rsa.pub后,连接服务器却报: Agent admitted failure to sign using the key 错误. 解决方法: 在当前用户下执行命令: ...