TIME dimension script Oracle
1 2 3 4 5 6 7 8 9 10 11 12 |
SELECT n AS time_id, TO_CHAR(to_date(n,'SSSSS'),'HH24') AS hour, TO_CHAR(to_date(n,'SSSSS'),'MI') AS minute, TO_CHAR(to_date(n,'SSSSS'),'SS') AS second FROM ( SELECT level-1 n FROM DUAL CONNECT BY LEVEL <= 86400 ) |