| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 
 | /* SQL formatted with free online SQLinForm Engine Release 4.6.14 */
 
WITH datas AS
     (SELECT to_date ('01/07/2009','DD/MM/YYYY') jour,
             12                                  nbr
     FROM    dual
 
     UNION
 
     SELECT to_date ('02/07/2009','DD/MM/YYYY') ,
            12
     FROM   dual
 
     UNION
 
     SELECT to_date ('03/07/2009','DD/MM/YYYY') ,
            10
     FROM   dual
 
     UNION
 
     SELECT to_date ('04/07/2009','DD/MM/YYYY') ,
            10
     FROM   dual
 
     UNION
 
     SELECT to_date ('05/07/2009','DD/MM/YYYY') ,
            5
     FROM   dual
 
     UNION
 
     SELECT to_date ('06/07/2009','DD/MM/YYYY') ,
            4
     FROM   dual
     )
SELECT DISTINCT first_value(jour) over (partition BY nbr ORDER BY jour ) jr,
                nbr
FROM            datas
ORDER BY        jr ; | 
Partager