Archivo de la etiqueta: Oracle Dates

Generating Dates between two date ranges Oracle

select to_char(trunc(to_date(20190822,’YYYYMMDD’),’MM’),’YYYYMMDD’)-1 + level as Date1,to_char(to_date(to_char(trunc(to_date(20190822,’YYYYMMDD’),’MM’),’YYYYMMDD’),’YYYYMMDD’)-2 + level,’YYYYMMDD’) as Date2 from dual connect by level <= to_char(last_day(to_date(20190822,’YYYYMMDD’)),’DD’) order by Date1;

Publicado en DataBase, Oracle Data Base | Etiquetado , , | Deja un comentario