LEAD(expr [, N[, default]]) [null_treatment] over_clause

Returns the value of expr from the row that leads (follows) the current
row by N rows within its partition. If there is no such row, the return
value is default. For example, if N is 3, the return value is default
for the last three rows. If N or default are missing, the defaults are
1 and NULL, respectively.

N must be a literal nonnegative integer. If N is 0, expr is evaluated
for the current row.

N cannot be NULL, and must be an integer in the range 0 to 263,
inclusive, in any of the following forms:

o an unsigned integer constant literal

o a positional parameter marker (?)

o a user-defined variable

o a local variable in a stored routine

over_clause is as described in
https://dev.mysql.com/doc/refman/8.4/en/window-functions-usage.html.
null_treatment is as described in the section introduction.

For an example, see the LAG() function description.

URL: https://dev.mysql.com/doc/refman/8.4/en/window-function-descriptions.html

