How can I insert
the data into multiple tables using a select query
?
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;