title: multiple values insert join in mysql
body: <p>I have a query submitting multiple items in table <code>a</code>.</p>
  
  <p>For example:</p>
  
  <pre><code>insert into a values(id,name) (5,'john'),(6,'smith');
  </code></pre>
  
  <p>Though I also need to select some third value from other table with this id.</p>
  
  <p>For example:</p>
  
  <pre><code>insert into a values(id,name,money) (5,'john',(select money from b where id=5)),(6,'smith',(select money from b where id=6));
  </code></pre>
  
  <p>The problem with the above is that it's a bit repetitive and also uses sub selects.</p>
  
  <p>I wonder if it's possible to rewrite this using <code>JOIN</code>, (which should also reassure that there <em>is</em> a relation to the table b on that given id, lest it inserts a NULL).</p>
  
  <p>Any ideas?</p>