In PostgreSQL the lead()
function returns the value from a subsequent row to the current row, specified by the given offset.
The offset specifies how many rows after the current row to get the value from. For example, an offset of 1
gets the value from the next row.