title: MySQL - SUM DateTime?
body: <p>I need sum datetime values, but I don't know how I can do this.</p>
  
  <p>I've the table:</p>
  
  <p><a href="https://i.stack.imgur.com/ZOZni.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ZOZni.png" alt="enter image description here"></a></p>
  
  <p>And my query:</p>
  
  <pre><code>SELECT 
      SUM(h.dtplay) AS Time 
  FROM 
      tblhistory AS h, 
      tblgame AS g 
  WHERE 
      h.idgame = g.id AND 
      g.description = gameName;
  </code></pre>
  
  <p>But, when I run that query, my result is:</p>
  
  <p><a href="https://i.stack.imgur.com/HhKff.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HhKff.png" alt="enter image description here"></a></p>
  
  <p>Why it's incorrect?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I change the format from datetime to time in my table:</p>
  
  <p><a href="https://i.stack.imgur.com/H8L6y.png" rel="noreferrer"><img src="https://i.stack.imgur.com/H8L6y.png" alt="enter image description here"></a></p>
  
  <p>So, I need sum the time values.</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>The correct query:</p>
  
  <pre><code>SELECT 
     SEC_TO_TIME(SUM(TIME_TO_SEC(h.DtPlay))) AS Time 
  FROM 
     tblhistory AS h, 
     tblgame AS g 
  WHERE 
     h.idgame = g.id AND 
     g.description = gameName;
  </code></pre>
  
  <p>Thanks for @Newbee Dev and @EhsanT  :)</p>