title: Add columns dynamically in the result of a query. Oracle
body: <p>I have a query that retrieve two columns.</p>
  
  <p>Like this:</p>
  
  <pre><code>select subscription_id, months from subscriptions;
  </code></pre>
  
  <p>Now, the result is like this:</p>
  
  <pre><code>subscription_id  months
        1254         4
        5896         1
        8965         3
  </code></pre>
  
  <p>I want to add in the result of the query, in the right side, columns dynamically, depends of the number of months that are retrieved. If the result for one record is 4, I'll add for the next 4 columns the value 4 over the same row and so on. </p>
  
  <p>Example:</p>
  
  <pre><code>subscription_id  months    0     1    2    3    4    5
        1254         4       4     4    4    4    4
        5896         1       1     1
        8965         3       3     3    3    3    3
  </code></pre>
  
  <p>NOTE: I'm using Oracle 10g, pivot is not possible to use.</p>