title: How to Pivot rows into columns using Decode where the content is variable
body: <p>I'm having some trouble with formatting so hopefully my description makes sense. I am writing a query for an Oracle DB that doesn't support the Pivot function, but I have used Decode in the past to achieve a similar result.</p>
  
  <p>The query so far returns a table of 2 columns, the first is a text label, the second is an item number. Every row will contain a label and an item number, the item numbers will each be unique but the labels will repeat.</p>
  
  <p>For example     </p>
  
  <pre><code>A - 101  
  B - 102  
  A - 103  
  C - 104  
  B - 105  
  A - 106  
  </code></pre>
  
  <p>I would like to pivot this so I have one row for each text label and as many columns as necessary to show all the matching item numbers. So the table would look like</p>
  
  <pre><code>A - 101 - 103 - 106  
  B - 102 - 105  
  C - 104
  </code></pre>
  
  <p>The quantity of numbers that need to be pivotted is variable, as are the item numbers themselves. Is this possible to do using the decode function, or any other function?</p>