16.20 - Types of Expressions - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2020-03-25
dita:mapPath
xzf1512079057909.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
kby1472250656485

SQL expressions generally fall into the following categories.

Type Description
Numeric expression Expressions are generally classified by the type of result they produce.

For example, a numeric expression consists of a column name, literal, function, or combination of column names, literals, and functions connected by arithmetic operators where the result is a numeric type.

String expression
DateTime expression
Interval expression
Period expression, including a derived period
CASE expression A CASE expression consists of a set of WHEN/THEN clauses and an optional ELSE clause.

A valued CASE expression tests for the first WHEN expression that is equal to a test expression and returns the value of the matching THEN expression. If no WHEN expression is equal to the test expression, CASE returns the ELSE expression, or, if omitted, NULL.

A searched CASE expression tests for the first WHEN expression that evaluates to TRUE and returns the value of the matching THEN expression. If no WHEN expression evaluates to TRUE, CASE returns the ELSE expression, or, if omitted, NULL.