16.20 - Example: Using a CASE Expression - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Functions, Expressions, and Predicates

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

A CASE expression can be used in place of any value-expression.

   SELECT *
   FROM t
   WHERE x = CASE y
              WHEN 2
              THEN 1001
              WHEN 5
              THEN 1002
             END;