我正在尝试从特定行的数据更新几行
这是一个单一的表,
我的尝试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'