LAST Function | Teradata Vantage - 17.10 - LAST - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Time Series Tables and Operations

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

Returns the newest value, determined by the timecode, for each group. LAST is a single-threaded function.

To invoke the LAST function, use the GROUP BY TIME clause.

Return Values

The return value is the same data type as the input data type.

Nulls are not included in the result computation.

Usage Notes

LAST is only valid on numeric data.

In the event of a tie, such as simultaneous timecode values for a particular group, all tied results are returned. If a sequence number is present with the data, it can break a tie, assuming it is unique across identical timecode values.