title: How to write a SQL query that concatenates multiple rows from the input table into one row in the output table
body: <p>Given the following sample table:</p>
  
  <pre><code>C1     C2      C3
  =================
  A      21      S
  A      22      S
  A      23      S
  A      24      T
  B      25      S
  B      26      S
  </code></pre>
  
  <p>How can I write an SQL query to give the following output:</p>
  
  <pre><code>COL1   COL2       COL3
  ======================
  A      21,22,23      S
  A      24            T
  B      25,26         S
  </code></pre>
  
  <p>For all rows in the input table where C1 and C3 are the same, I want one row in the output table that has all the C2 values concatenated, comma separated.</p>
  
  <p>I'm working with an Oracle database.</p>