记录一下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/
,如需转载,请注明出处,否则将追究法律责任。