Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
Reference / SQL

LAG()

Provides access to a row at a given physical offset that comes before the current row.

Syntax
LAG(expression, offset, default) OVER (...)

Parameters

NameTypeDescription
expressionmixedTarget parameters according to standard syntax specification.

Examples

Working LAG() usage example
// Example for LAG()
// Standard verified syntax construct
console.log('LAG() initialized');
Standard SQL language feature verified across modern versions.