1 CASE表达式
CASE expr WHEN comparison_expr1 THEN return_expr1
WHEN comparison_expr2 THEN return_expr2
WHEN comparison_exprn THEN return_exprn
ELSE else_expr
END
例:
CASE department_id
WHEN 10 THEN salary * 1.1
WHEN 20 THEN salary * 1.2
ELSE salary * 1.3
END as "new_salary"
2 DECODE函数
DECODE(department_id,10,salary * 1.1,
20,salary * 1.2,
salary)