私が盲目である場合は申し訳ありませんが、これは意味がありません. 複数のSQLソリューションを使用した以外に、構文でまだエラーが発生しています...
ここに私のphpコード:
$sql1 = " SELECT table1.file_name, table2.path
FROM table1 AS t1
LEFT JOIN table2 AS t2
ON t1.file_name = t2.path
WHERE t2.path IS NULL OR t1.file_name <> t2.file_name OR t1.file_name <> t2.path";
$sql2 = "INSERT INTO table3 (file_name) VALUES(".$sql1.")";
Shopware()->Db()->query($sql2);
私のエラーメッセージ:
SQLSTATE[42000]: Syntax error or access violation: 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 table1.file_name, table2.path FROM (the first 2 letters of table1)' at line 1 in Zend\Db\Statement\Pdo.php on line 234