我想通过将列乘以列来更新total
table:中的列。tbl_orders
quantity
cost
UPDATE `tbl_orders` SET
total = (SELECT quantity * cost AS n1 FROM `tbl_orders` WHERE orderid = 167 LIMIT 1)
WHERE orderid= 167 LIMIT 1
我之前做过子查询更新,但是返回的mysql错误是:
您不能在 FROM 子句中指定目标表 'tbl_orders' 进行更新
谁能看到我做错了什么?