WHEN search conditions have the following properties:
- Can take the form of any comparison operator, such as LIKE, =, or <>.
- Can be a quantified predicate, such as ALL or ANY.
- Can contain a scalar subquery.
- Can contain joins of two tables.
For example:
SELECT CASE WHEN t1.x=t2.x THEN t1.y ELSE t2.y END FROM t1,t2;
- Cannot contain SELECT statements.