|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
Problem with to_date
I am having a problem with Oracle SQL where I would like to figure out the busiest hour from my list of entries:
I have created a table as such - CREATE TABLE table1( person INTEGER ,whn DATE ,code VARCHAR(10) ,PRIMARY KEY (person,whn) ); And populated the table with - INSERT INTO table1 VALUES (1,TO_DATE('25 Feb 2003 06:10:00','dd Mon YYYY HH24:MI:SS'),'XE 0A DB'); and so on! Yet I cannot figure out how I would go about finding the busiest hour for a single person. I understand MAX and MIN to find which would be the first and last entry hours... though the answer to find which hour they have the most entries elludes me?!? Thank you for any reply. Regards, Poot. |
|
#2
|
||||
|
||||
|
You would be best to do a substring on the date field so that you only have the time and then do a group/count of that field. That way you will have the time and the number it appears each time, then sort by that and limit the result to one record.
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Problem with to_date |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|