2020-12-17

SQL to quickly generate 24h slices from dmitri

 select

trunc(sysdate)+(rownum-1)/24 dt_start,

trunc(sysdate)+(rownum)/24 dt_end

from (

-- generate 32 (2^5) dummy rows

SELECT 1 FROM DUAL GROUP BY CUBE (1,2,3,4,5)

) dummy32

where rownum <= 24;

--ORDER BY 1;

Niciun comentariu:

Trimiteți un comentariu