title: sql query db2 9.7
body: <p>Recursive query in <code>DB2</code> to get items in the chain. There is a table</p>
  
  <pre><code>WITH t (id,a) AS (VALUES (1,3),(1,6),(1,9),(2,7),(2,11),(3,5))
  SELECT * FROM t
  </code></pre>
  
  <p>The output should be like this</p>
  
  <pre><code>id   | a
  ------------
  1    | 3,6,9
  
  2    | 7,11
  
  3    | 5
  </code></pre>
  
  <p>How can I do this using recursive query? Thanks in advance.</p>