Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need SQL to get Max Value on Day in a table with hourly data

538263Dec 9 2008 — edited Dec 9 2008
I've got a table 'tmp' with these columns :

id,day,hour,value

I want to get the 'hour' when max of 'value' is reached for each 'day'.

the query :

"SELECT id,day,hour,max(value) from tmp group by id,day,hour"
doesn't return the wanted rows.

Do you have any idea to get what I want ?
This post has been answered by 513949 on Dec 9 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 6 2009
Added on Dec 9 2008
4 comments
2,936 views