title: how to insert data into multiple table using select query in mysql
body: <p>How can I <code>insert</code> the data into multiple tables using a <code>select query</code>?</p>
  
  <pre><code>INSERT INTO PermissionRole(code,isValid,longValue,shortValue),
  INSERT INTO PermissionRole_authorisedFunctions 
  VALUES(LAST_INSERT_ID(),brfm.authorisedFunctionCode)
  SELECT urt.code, urt.isValid, urt.longValue, urt.shortValue, brfm.authorisedFunctionCode 
  FROM Ref_UserRoleType urt 
  INNER JOIN ref_businessrolefunctionmap brfm
  ON urt.code=brfm.businessRoleCode;
  </code></pre>