0

I have a table with 3 columns: DATE, HOUR, VALUE. This table has all the the days and hours of the month, and a numerical value. I want to group by the date, get the max from value, and the hour when that value occured. Can anyone help me achieve this?

This is what i have:

DATE HOUR VALUE

04/01/2023 12 49
04/01/2023 13 57
04/01/2023 14 42
04/01/2023 15 68
04/01/2023 16 48

This is what i'm expecting:

DATE HOUR VALUE

04/01/2023 15 68

June7
  • 19,874
  • 8
  • 24
  • 34
Alex
  • 31
  • 7
  • 1
    Use TOP N as demonstrated in above link or build an aggregate query that returns Max(Value) for each Date then INNER join that query to table with compound link on Date and value fields. Is there any possibility Value could duplicate for a Date? – June7 Feb 05 '23 at 01:05

0 Answers0