ITPub博客

首页 > 数据库 > Oracle > [Developer] NVL,NVL2,NULLIF,COALESCE,DECADE,CASE

[Developer] NVL,NVL2,NULLIF,COALESCE,DECADE,CASE

原创 Oracle 作者:tolilong 时间:2016-02-20 10:26:49 0 删除 编辑
记录一下NVL,NVL2,NULLIF,COALESCE,DECADE,CASE 函数的意思:

nvl(v1,v2)     if v1 is null then result=v2 else result=v1 end
nvl2(v1,v2,v3) if v1 is null then result=v3 else result=v2 end
nullif(v1,v2)  if v1=v2 then result=null else result=v1 end
coalesce(v1,v2,.....vn) return the first not null value.
decode(col1,v1,r1,v2,r2,.....,rn)  if col1=v1 then result=r1 else if col1=v2 then result=r2........else result=rn.
case when .... then .... end as colname.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24237320/viewspace-1991572/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: [HP-UX] HA切换命令
请登录后发表评论 登录
全部评论

注册时间:2010-07-13

  • 博文量
    406
  • 访问量
    1208675