PLSQL Developer 中decode()函数的基本用法?本人完全是刚刚接触IT网上的很多教程都看不懂-.-

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/03 09:25:34
PLSQL Developer 中decode()函数的基本用法?本人完全是刚刚接触IT网上的很多教程都看不懂-.-

PLSQL Developer 中decode()函数的基本用法?本人完全是刚刚接触IT网上的很多教程都看不懂-.-
PLSQL Developer 中decode()函数的基本用法?
本人完全是刚刚接触IT网上的很多教程都看不懂-.-

PLSQL Developer 中decode()函数的基本用法?本人完全是刚刚接触IT网上的很多教程都看不懂-.-
decode(a,b,c,d,e,.)
如果a=b,则输出c,a=d,则输出e,否则.
e.g select decode('a','a','1','b','2','3') from dual
'a'='a' 输出1
select decode('b','a','1','b','2','3') from dual
'b'!='a' ‘b'='b' 输出2
select decode('c','a','1','b','2','3') from dual
'c'!='a' 'c' !='b' 输出3
就是相当于变形了的if..else..语句