title: SQL: Copy one row multiple times, changing one value each time
body: <p>I have a row of data in a table:</p>
  
  <pre><code>Key | Val1 | Val2
  ----+------+-----
  1   | A    | B
  </code></pre>
  
  <p>I would like to copy this row, but assign each new row a different key (actually a foreign key) from a list:</p>
  
  <pre><code>New keys
  --------
  2
  3
  4
  </code></pre>
  
  <p>This list can easily be obtained via a query.  After the duplication, the table should look like this:</p>
  
  <pre><code>Key | Val1 | Val2
  ----+------+-----
  1   | A    | B
  2   | A    | B
  3   | A    | B
  4   | A    | B
  </code></pre>
  
  <p>So far, all I've come up with is this:</p>
  
  <pre><code>INSERT INTO table (Key, Val1, Val2) (
      SELECT '2' AS Key, Val1, Val2 FROM table WHERE Key='1'
  );
  </code></pre>
  
  <p>This works, but of course it only copies one row at a time.  Is there a way to copy all the rows at once?</p>
  
  <p>I'm using Oracle if it makes a difference.</p>