16.20 - LAG/LEAD Functions - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ NewSQL Engine Release Summary

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
created_date
March 2019
category
Release Notes
featnum
B035-1098-162K

The LAG and LEAD functions add to the ordered analytic capabilities provided by Teradata Database. The LAG function accesses data from a row preceding the current row at a specified offset value in a window group, while the LEAD function returns data from a row following the current row at a specified offset value in a window group.

The functions improve compatibility, and are used with Teradata Database for OLAP and decision support queries. The functions support both Teradata syntax and ANSI syntax to improve data migration.

Benefits

  • Provides compatibility with and simplifies data migration from other databases.
  • Increases Teradata Database compatibility to the SQL Standard.

Considerations

The LEAD function returns the value displayed in a following row, while the LAG function gives the value from a previous row.

Additional Information

For more information on the LAG/LEAD functions, see Teradata Vantageā„¢ SQL Functions, Expressions, and Predicates, B035-1145.