16.20 - Rules for WHEN Search Conditions - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1145-162K
Language
English (United States)

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.