Use the LEAD function to access data from the following or a subsequent row of a result set. The first parameter is the expression to select a value from a subsequent row. The second parameter is the offset, such as 1, to indicate the following row. The third parameter is the default, or substitute, value to use if the subsequent row reference is not available.


LEAD (expression, offset_value, default_value) over (partition_by … or der_by …)