title: Calculate the total time duration on last row in mysql
body: <p>I have this mysql query:</p>
  
  <pre><code>SELECT CONCAT(u.lastname, ', ', u.firstname) AS Name, start.timestamp start, end.timestamp end, timediff(end.timestamp, start.timestamp) duration 
      from user u, user_group ug, (
      select *, (
          select event_id from event L2 where L2.timestamp&gt;L1.timestamp and L2.user_bannerid=L1.user_bannerid order by timestamp limit 1
      ) stop_id from event L1
  ) start join event end on end.event_id=start.stop_id
  where start.status='In' and end.status='Out' and u.user_bannerid = start.user_bannerid and ug.user_bannerid = u.user_bannerid  and ug.group_id = start.group_id 
  </code></pre>
  
  <p>And it shows something like this:</p>
  
  <pre><code>+----------------------------------------------------+---------------+
  | Name   | start               | end                 | duration      |    
  +----------------------------------------------------+---------------+
  | User   | 2011-11-24 02:12:05 | 2011-11-24 02:12:20 | 00:00:15      |       
  | User   | 2011-11-28 21:46:54 | 2011-11-28 21:53:01 | 00:06:17      |
  +----------------------------------------------------+---------------+
  </code></pre>
  
  <p>But i want the last row to show the total number of duration like:</p>
  
  <pre><code>+----------------------------------------------------+---------------+
  | Name   | start               | end                 | duration      |    
  +----------------------------------------------------+---------------+
  | User   | 2011-11-24 02:12:05 | 2011-11-24 02:12:20 | 00:00:15      |       
  | User   | 2011-11-28 21:46:54 | 2011-11-28 21:53:01 | 00:06:17      |
  |        |                     |                     | 00:06:32      |
  +----------------------------------------------------+---------------+
  </code></pre>
  
  <p>Can someone please help me modify the query to show sum of the duration on the next row? </p>