Ambas as funções tem como sua sintaxe parecidas:
LAG (value_expression [,offset] [,DEFAULT]) OVER ([query_partition_clase] order_by_clause) LEAD (value_expression [,offset] [,DEFAULT]) OVER ([query_partition_clase] order_by_clause)
LAG
Esta é uma função analitica. Que provem o acesso a mais que um registro de uma tabela ao mesmo tempo sem precisar fazer um join na própria tabela self join. A busca irá retornar uma ou mais registros anteriores a da possição atual (current). Read the rest of this entry »
0