Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> help creating a hour list with sql.
I have a problem with creating a select statement that must display a a list
of hours and a count how many times they are in the table.
Table (hourtbl)
Name Time
sca 01/01/1999 2:22:30 dfe 01/01/1999 8:24:12 dfd 01/01/1999 2:23:11 fdd 01/01/1999 3:12:32 ggs 01/01/1999 8:34:45
prefered Result :
Time count
01/01/1999 1 0 01/01/1999 2 2 01/01/1999 3 1 01/01/1999 4 0 01/01/1999 5 0 01/01/1999 6 0 01/01/1999 7 0 01/01/1999 8 2
What I have until now:
select count(*),
TO_DATE(hourtbl,'MM/DD/YY HH24)
from v$loghist
group by TO_DATE(hourtbl,'MM/DD/YY HH24)
/
Result
Time count
01/01/1999 2 2 01/01/1999 3 1 01/01/1999 8 2
Now I must place the hours that have 0 transactions.
Please help Received on Tue Jan 18 2000 - 07:43:27 CST
![]() |
![]() |