Oracle LAG & LEAD Functions / Arabic

Опубликовано: 03 Ноябрь 2024
на канале: khaled alkhudari
2,072
52

--The LAG function is used to access data from a previous row
--LAG (value_expression [,offset] [,default]) OVER ([query_partition_clause] order_by_clause)
--value_expression - Can be a column or a built-in function, except for other analytic functions.
--offset - The number of rows preceeding/following the current row, from which the data is to be retrieved. The default value is 1.
--default - The value returned if the offset is outside the scope of the window. The default value is NULL.


-- The LEAD function is used to return data from the next row.
--LEAD (value_expression [,offset] [,default]) OVER ([query_partition_clause] order_by_clause)