Rules for WHEN Search Conditions

Teradata Vantageā„¢ SQL Functions, Expressions, and Predicates

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

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.