Oracle
 sql >> Database >  >> RDS >> Oracle

Come popolare la tabella del calendario in Oracle?

Questo è un modo semplice e facile per farlo

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