Loading time dimension table [message #305729] |
Tue, 11 March 2008 14:20  |
kanjiri123
Messages: 3 Registered: March 2008
|
Junior Member |
|
|
I need to populate a table dim_time(timeseq number, timenow date)
such as i can get each and evry second of the day like
00:00:00
00:00:01
00:00:02
.
.
00:59:59
01:00:00
01:00:01
.
.
23:59:59
can someone help me with this.
Thanks in advance.
|
|
|
Re: Loading time dimension table [message #305731 is a reply to message #305729] |
Tue, 11 March 2008 14:28   |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
A simple row generator and a little maths :
SELECT Trunc(SYSDATE) + ( 1 / (24 * 60 * 60) ) * ( rownum - 1 )
FROM ( SELECT 1 just_a_column
FROM dual
CONNECT BY LEVEL <= (24 * 60 * 60)
)
|
|
|
|