16.20 - Example: Evaluating a Search Condition - 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

The following statement is equivalent to the first example of the valued form of CASE on “Example”:

   SELECT SUM(CASE 
               WHEN part='1'
               THEN cost
               ELSE 0
              END
             ) / SUM(cost)
   FROM t;