The simple CASE expression checks only for equivalent values and can not contain Boolean expressions. ]Ī searched CASE expression allows comparison operators, and the use of AND and/or OR between each Boolean expression. If these expressions are equivalent, the expression in the THEN clause will be returned. A simple CASE expression operates by comparing the first expression to the expression in each WHEN clause for equivalency. Within a SELECT statement, a simple CASE expression allows only an equality check no other comparisons are made. Two basic formulations for CASE expressionĪ simple CASE expression checks one expression against multiple values. Example of where CASE expressions can be used include in the SELECT list, WHERE clauses, HAVING clauses, IN lists, DELETE and UPDATE statements, and inside of built-in functions. CASE expressions can be used in SQL anywhere an expression can be used.
0 Comments
Leave a Reply. |