title: sub query with comma delimited output in one column
body: <p>I need help with writing a query where the query output displays a column with comma delimited data.</p>
  
  <p>I have two tables with one to many relationship. I want to write a query which outputs all records from table with one record but display comma delimited data in one column from the table having many records.</p>
  
  <p>Table1</p>
  
  <pre><code>Col1 Col2 Col3
  a1     1   4
  a2     2   5
  a3     3   6
  a4     7   8
  </code></pre>
  
  <p>Table2</p>
  
  <pre><code>Col1 Col4
  a1     10
  a1     11
  a1     22
  a2     10
  a2     11
  a3     19
  a3     22
  a3     23
  a4     15
  </code></pre>
  
  <p>Query output:</p>
  
  <pre><code>Col1 Col2 Col3 Col4
  a1     1   4    10,11,22
  a2     2   5    10,11
  a3     3   6    19,22,23
  a4     7   8    15
  </code></pre>
  
  <p>Thanks in advance</p>