title: Oracle - split single row into multiple rows based on column value
body: <p>I have a table like this</p>
  
  <pre><code>parent_item  child_item  quantity
            A           B         2
            A           C         3
            B           E         1
            B           F         2
  </code></pre>
  
  <p>And would like to split this in multiple lines based on the quantity</p>
  
  <pre><code>parent_item  child_item  quantity
           A            B         1
           A            B         1
           A            C         1
           A            C         1
           A            C         1
           B            E         1
           B            F         1
           B            F         1
  
  The column quantity (1) is not really necessary.
  </code></pre>
  
  <p>I was able to generate something with the help of connect by / level, but for large tables it's very very slow.I'm not really familiar with connect by / level, but this seemed to work, although I can't really explain:</p>
  
  <pre><code>select distinct parent_item, level LEVEL_TAG, child_item, level||quantity
  FROM table
  CONNECT BY quantity&gt;=level
  order by 1 asc;
  </code></pre>
  
  <p>I found similar questions, but in most cases topicstarter want's to split a delimited column value in multiple lines (<a href="https://stackoverflow.com/questions/25888841/oracle-split-single-row-into-multiple-rows">Oracle - split single row into multiple rows</a>)</p>
  
  <p>What's the most performant method to solve this?</p>
  
  <p>Thanks</p>