title: How to grab the DATE that the MAX occurred?
body: <p>So i have  a table called Value. This table has columns called: VALUE_ID, VALUE, HR, VALUE_TYPE. I am trying to grab not only the maximum value but also the HR (and ultimately the day) that the Maximum Value Occurred.</p>
  
  <p>Below is some sample data:</p>
  
  <pre><code>VALUE_ID      VALUE     HR                           VALUE_TYPE
     1            75      DEC-25-2018 01:00:00 AM      Bananas
     2            10      DEC-25-2018 01:00:00 AM      Bananas
     3            787     DEC-25-2018 05:00:00 PM      Bananas
  </code></pre>
  
  <p>I want:</p>
  
  <pre><code> (For Hourly)
   MAX(Value)         HR                          Value_Type
     75               DEC-25-2018 01:00:00 AM     Bananas
     787              DEC-25-2018 05:00:00 PM     Bananas
  
   (For Day)
   MAX(Value)         HR(Day)                     Value_Type
     787              DEC-25-2018 05:00:00 PM     Bananas
  </code></pre>
  
  <p>I've tried the following (this is probably completely wrong but im not sure how to combine columns from two separate queries into one table):</p>
  
  <pre><code>select max(value) as max_value
      , Value_Type
   from value
  group by value_type
  UNION
  select HR from
   from value 
  where value = (select max(value) as max_value
          , Value_Type
   from value
  group by value_type;
  </code></pre>
  
  <p>Thanks in advance.</p>