当前所在位置:珠峰网资料 >> 计算机 >> Oracle认证 >> 正文
2015年Oracle认证考试辅导:Oracle中decode()函数的使用技巧
发布时间:2010/3/13 11:26:12 来源:城市学习网 编辑:MOON
  decode函数的使用技巧:
  软件环境:
  1、windows nt4.0 oracle 8.0.4
  2、oracle安装路径为:c:“orant
  含义解释:
  decode该函数的含义if 条件=值1 thenreturnelsif 条件=值2 thenreturn......elsif 条件=值n thenreturnelsereturnend if使用方法:
  1、比较大小
  0select decode,-1,变量1,变量2) from dual. 取较小值
  sign函数根据某个值是0、正数还是负数,分别返回0、1、-1
  例如:
  变量1=10,变量2=20
  则sign返回-1,decode解码结果为“变量1”,达到了取较小值的目的。
广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved