Types of Expressions - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantageā„¢

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.