Oracle/PLSQL: RANK Function over partition by

Posted by Bento | Posted in Banco de Dados, Oracle | Posted on 26-05-2015-05-2008

0

RANK Function  OVER (PARTITION BY

 

,RANK() over (partition by   to_char(CI.DAT_REALIZACAO,’mm/yyyy’)                                      –,b.mes_ano_ref
ORDER by  CI.DAT_REALIZACAO) RANK

Irá mostrar a ordenação pelo ranking, exemplo:

11/04/2015 – 1

12/04/2015 – 2

13/04/2015 – 3

13/04/2015 – 3

15/04/2015 – 4

16/04/2015 – 5

16/04/2015 – 5

Write a comment