title: MySQL: How to insert a record for each result in a SQL query?
body: <p>Say I have a select</p>
  
  <pre><code>SELECT DISTINCT id, customer_id, domain FROM config WHERE type = 'foo';
  </code></pre>
  
  <p>which returns some records.</p>
  
  <p>How can I do an insert for reach row in the result set like</p>
  
  <pre><code>INSERT INTO config (id, customer_id, domain) VALUES (@id, @customer_id, 'www.example.com');
  </code></pre>
  
  <p>where <code>@id</code> and <code>@customer_id</code> are the fields of the row in the result set?</p>
  
  <p>edit: I didn't want to just duplicate it, but insert a new value in the field <code>domain</code> instead. Nevertheless a facepalm-situation as it's plain easy ;-) Thanks!</p>