title: Convert a single column values into a single row in sql oracle
body: <p>I have created a simple table which holds numbers as below:</p>
  
  <pre><code>CREATE TABLE saleshist (q1 NUMBER);
  INSERT INTO saleshist VALUES (100);
  INSERT INTO saleshist VALUES (101);
  INSERT INTO saleshist VALUES (102);
  INSERT INTO saleshist VALUES (103);
  
  select * from saleshist
  </code></pre>
  
  <p>The above select shows  a single column like:</p>
  
  <pre><code>100
  102
  102
  103
  </code></pre>
  
  <p>I wish to see the output like below:</p>
  
  <pre><code>100,101,102,103
  </code></pre>
  
  <p>Yes its a comma separated column value in a single row as a single value.
  This is just an example that I had in mind and column values can be many.
  I guess UNPIVOT can do this But I am not able to understand that properly. 
  The best way I think of a solution to this is write a perl script and execute the query and then convert rows to columns with a comma separation.
  Is there a direct way to do this in sql itself?</p>