Database & utility
window
lead()
The value of expr n rows after the current row, or the default. Can IGNORE or RESPECT NULLS.
Reference: DuckDB 2.0.0
Arguments & returns
lead(col, offset, default)
window
| Overload link | col | offset | default |
Returns |
|---|---|---|---|---|
| #01 | T | BIGINT | ANY |
T |
Example
1 more ↓Haybarn WASM 2.0.0-rc12 · In your browser
Engine example with sample data · Run to view results.
More examples
Haybarn WASM 2.0.0-rc12 · 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
SELECT LEAD(salary, 1, 0) OVER (ORDER BY hire_date) AS prev_sal FROM employees