title: MySQL SUM total minutes activated
body: <p>I need to make the sum of the total minutes that a certain status has been activated.</p>
  
  <p>[Example][1]</p>
  
  <pre><code>id     disp_id  state   created_at
  764912  2         1       11/06/2018 12:03
  765261  2         1       11/06/2018 12:08
  765401  2         1       11/06/2018 12:10
  765540  2         1       11/06/2018 12:12
  765610  2         1       11/06/2018 12:13
  765889  2         1       11/06/2018 12:17
  766029  2         1       11/06/2018 12:19
  766098  2         1       11/06/2018 12:20
  766168  2         1       11/06/2018 12:21
  766656  2         1       11/06/2018 12:28
  </code></pre>
  
  <p>i need this sum:</p>
  
  <pre><code>03-&gt;08 = 5 minutes
  08-&gt;10 = 2 minutes
  10-&gt;12 = 2 minutes
  12-&gt;13 = 1 minutes
  13-&gt;17 = 4 minutes
  17-&gt;19 = 2 minutes
  19-&gt;20 = 1 minutes
  20-&gt;21 = 1 minutes
  21-&gt;28 = 7 minutes
  </code></pre>
  
  <p>Total: 25 minutes</p>
  
  <p>I tried (SUM(minute(a.created_at))) but i have the total sum of the minutes</p>
  
  <p>03+08+10+12+13+17+19+20+21+28=151</p>
  
  <p>Is it possible to perform this SQL using sum?</p>
  
  <p>thank you!</p>