You shouldn't nest select
in a values
statement. SQL offers much better syntax:
INSERT IGNORE INTO com_myisam_app_titles(id_company, title)
SELECT a.id_company, b.title
FROM com_apps a JOIN
epf_application b
ON a.application_id = b.application_id
WHERE NEW.id = a.id;
The problem is that the underlying query is returning more than one row and the values
statement cannot handle that. The above fixes that problem.
If you only want one row, add a limit 1
to the query:
INSERT IGNORE INTO com_myisam_app_titles(id_company, title)
SELECT a.id_company, b.title
FROM com_apps a JOIN
epf_application b
ON a.application_id = b.application_id
WHERE NEW.id = a.id
LIMIT 1;