Aggregates Aggregate

lead()

Arguments & returns

lead(col0, col1, col2)

Aggregate
Overload link col0col1col2 Returns
#01 TBIGINTT T

Example

lead example
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Guide example · Run to view results.

In other engines

ClickHouselead()

SELECT lead(salary, 1, 0) OVER (ORDER BY hire_date) AS prev_sal FROM employees
In Haybarn
SELECT LEAD(salary, 1, 0) OVER (ORDER BY hire_date) AS prev_sal FROM employees

SQLGlot example ↗

Snowflakelead()

Same function