特定の行のデータからいくつかの行を更新しようとしていますこれは
単一のテーブルであり
、私の試みItemNum
はユニークです:
UPDATE myTable t, (SELECT DISTINCT width, repeat
FROM myTable
WHERE ItemNum='80644') t1
SET t.width = t1.width
AND SET t.repeat = t1.repeat
WHERE ItemNum='80645'
AND WHERE ItemNum='80646'
#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 'FROM myTable WHERE ItemNum='80644') t1 SET t.width' at line 2
単一の行に対してこれを実行するとエラーが発生
しますが、複数の行の構文が問題のようです
UPDATE myTable t, (SELECT DISTINCT width
FROM myTable
WHERE ItemNum='80644') t1
SET t.width = t1.width
WHERE ItemNum='80645'