title: sql - insert new row where field equals another value
body: <p>Wherever CODE="BB", i want to insert a new row with all the same row/column data just change the CODE to "XX".</p>
  
  <p>For example:</p>
  
  <p><strong>Current Table:</strong></p>
  
  <pre><code>ID |    CODE  | Name
  ---+----------+---------
   1 |    AA    | Tom
   2 |    BB    | Mary
   3 |    AA    | John
   4 |    CC    | Carlos
   5 |    CC    | Mario
   6 |    BB    | Steve
   7 |    AA    | Pablo
  </code></pre>
  
  <p><strong>Same After SQL statement executed:</strong></p>
  
  <pre><code>ID |    CODE  | Name
  ---+----------+---------
   1 |    AA    | Tom
   2 |    BB    | Mary
   3 |    AA    | John
   4 |    CC    | Carlos
   5 |    CC    | Mario
   6 |    BB    | Steve
   7 |    AA    | Pablo
   8 |    XX    | Mary
   9 |    XX    | Steve 
  </code></pre>
  
  <p><strong>Can this be done in a SQL statement?</strong> rather than do what i was going to do which was create a script to loop through each record checking for "BB" and inserting a new row based on it's values.</p>