title: Concatenate multiple column into single in a resulted query
body: <p>I need a help in adding multiple column in single (DB2) after a resulted query</p>
  
  <p>My resulted query looks like,</p>
  
  <pre><code>EMPI   HRS  MTS  SDS
  -------------------
  sam    12   10   10
  tukai  10   05   02
  </code></pre>
  
  <p>Now, I want this output instead:</p>
  
  <pre><code>empid   Totaltimetaken
  ----------------------
  sam     12:10:10
  tukai   10:05:02
  </code></pre>
  
  <p>First query:</p>
  
  <pre><code>SELECT
      empid
      ,TOTALSECONDS/3600 AS HRS
      ,(MOD(TOTALSECONDS, 3600) /60) AS MTS
      ,(MOD(TOTALSECONDS, 60)) AS SDS
  FROM 
      (SELECT
          SUM(duration) AS TOTALSECONDS
          ,empid
       FROM table
       GROUP BY empid)
  </code></pre>
  
  <p>From the above query result, I now want to add the columns: <code>empid, hrs, mts, sds</code>. </p>
  
  <p>I used this query but not getting result. Any help...</p>
  
  <pre><code>SELECT 
      TMP1.emp
      ,('0'||(TOTALSECONDS.TMP1)/3600)||':'||
      ('0'||(MOD(TOTALSECONDS.TMP1),3600)/60) ':'||
      MOD(TOTALSECONDS.TMP1),60) AS TOTALTIMETAKEN
      ,TMP1.TOTALSECONDS
  FROM
     (SELECT 
         EMPID emp,
         SUM(DURATION) AS TOTALSECONDS
      FROM table
      GROUP BY EMPID) TMP1
  </code></pre>
  
  <p>This is for IBM DB2.</p>