有一个类似功能.这叫做CASE
份声明.
case 有两种形式:
Simple CASE:
CASE search-expression
WHEN expression [, expression [ ... ]] THEN
statements
[ WHEN expression [, expression [ ... ]] THEN
statements
... ]
[ ELSE
statements ]
END CASE;
Searched CASE:
CASE
WHEN boolean-expression THEN
statements
[ WHEN boolean-expression THEN
statements
... ]
[ ELSE
statements ]
END CASE;
CASE
条语句更容易阅读;比起甲骨文中的decode()
,我更喜欢这些.