Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL Code
Hi Kevin,
this might be what you want
SELECT
code_type, COUNT (code_type), TO_CHAR(dtdatetime, 'HH24')
cheers alex
> Hi All,
>
> I have an interesting problem, lets say I have a table with 2 fields, one
> with a code, and the other with a full datestamp, -+ 8 million records.
> What will the SQL code be to query this table, to show the result - the
> count of all codes that occur between every hour for the day, ie
>
> 5 counts of code type a, 6 of type b etc, between 01h00 and 02h00
> 7 counts of type a, 8 of b etc, between 02h00 and 03h00 etc etc etc
>
> Any ideas anybody ?
> Thanx
Received on Fri Jan 12 2001 - 02:54:57 CST
![]() |
![]() |