16.20 - Result Type - 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)

The data type of the LEAD or LAG function's returned values is the same as the specified value of value_expression. If default_value_expression and value_expression have different data types, Teradata recommends explicitly casting default_value_expression to the data type of value_expression.

In ANSI mode, an error occurs if default_value_expression and value_expression data types do not match.

In the Teradata Transaction (BTET) mode, if the data types do not match, the database attempts to cast the default_value_expression to the value_expression data type based on the internal casting rules. If this results in casting rule violations, an error message displays.