-
05-0705
-
[ <<label_name>> ]
CASE { WHEN boolean_expression THEN {statement;} … }…
[ ELSE {statement;}... ]
END CASE [ label_name ];simple_case_statement ::=
[ <<label_name>> ]
CASE case_operand
{ WHEN when_operand THEN {statement;} … }…
[ ELSE {statement;}... ]
END CASE [ label_name ];'————————————————————————————–
1.select cust_last_name,
CASE credit_limit WHEN 100 THEN 'Low'
WHEN 5000 THEN 'High'
ELSE 'Medium' END
FROM customers;2.select AVG(CASE WHEN e.salary > 2000 THEN e.salary
ELSE 2000 END) "Average Salary" from employees e;…
相关日志
发表评论






- 评论 (0)
- 引用通告 (0)
发表评论 发起引用