Oracle
 sql >> Base de données >  >> RDS >> Oracle

Comment remplir la table de calendrier dans Oracle ?

C'est un moyen simple et facile de le faire

with calendar as (
        select :startdate + rownum - 1 as day
        from dual
        connect by rownum < :enddate - :startdate
    )
select rownum as "S.No", to_date(day,'dd_mm_yyyy') as "Cal_Dt", to_char(day,'day') as "DayName"
from calendar