title: SQL - Splitting a string into a new row
body: <p>I have a table with with two columns as shown below: </p>
  
  <pre><code>A001    A1;A2;A3
  B002    B1
  C003    C1;C2
  D004    D1;D2;D3;D4
  E005    E1
  </code></pre>
  
  <p>The table has two columns, the second column has contains either a single value or multiple values as a string separated by a semicolon. </p>
  
  <p>What i would like to do is for each of the rows where the value is a string with multiple values, i want to split the string and use each value to insert a new row (duplicating the value from the first column for the new row). </p>
  
  <p>With the above sample data, the output would be something like this:</p>
  
  <pre><code>A001 A1
  A001 A2
  A001 A3
  B002 B1
  C003 C1
  C003 C2
  D004 D1
  D004 D2
  D004 D3
  D004 D4
  E005 E1
  </code></pre>