Funções analiticas LAG/LEAD

0

Posted on : 01-10-2008 | By : .rafa | In : Oracle, PL/SQL

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 »