title: MySQL - Get time in minutes for time values over an hour
body: <p>I have time stored in my table in the following format</p>
  
  <pre><code>*----------*-----------*
  |   press  |    time   |
  *----------*-----------*
  |Press One | 00:45:23  |
  |Press Two | 01:01:34  | 
  </code></pre>
  
  <p>Where time is in %hh %mm %ss format. What I need is the average of the time column grouped by press column where time returned is in minutes. With the following query I get what I need until the time average is 59 minutes. And I understand that TIME_FORMAT(x, '%i') will give 0-59 minutes. </p>
  
  <p>My Question: How do I get the time average to return in Minutes even if returned time is over 59 minutes.    </p>
  
  <pre><code>SELECT press, 
         TIME_FORMAT(
             SEC_TO_TIME(
                 TRUNCATE(
                     AVG(time)
                 , 0)
             )
         ,'%i') 
        as time 
  FROM pressmr 
  GROUP BY press
  </code></pre>