17.10 - Result Type - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
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.