title: mysql multiple Insert where select many column from another table
body: <p>I have the following data:</p>
  
  <p>table1:</p>
  
  <pre><code>id  common_criteria        member_id
  1       some                 1000
  2       some1                 500
  3       some                  100
  4       some                  200
  3       some1                2000
  </code></pre>
  
  <p>table2</p>
  
  <pre><code>id member_id
  </code></pre>
  
  <p>The <code>id</code> columns are <code>AUTOINCREMENT PRIMARY KEY</code> on both tables</p>
  
  <p>I need to insert into <code>table2</code> three new rows (in this case) where <code>common_criteria</code> from <code>table1</code> = 'some'</p>
  
  <p>Expected result for table2:</p>
  
  <pre><code>id    member_id
  1       1000
  2       100
  3       200
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>INSERT into table2 (`member_id`) 
  VALUES (
   SELECT `member_id` FROM table1 WHERE common_criteria = 'some'
  )
  </code></pre>
  
  <p>But I get a syntax error:</p>
  
  <blockquote>
    <p>#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
    near 'SELECT <code>member_id</code> FROM table1 WHERE common_criteria = 'some')'
    at line 1</p>
  </blockquote>