MySQL doesn't allow this construct. Instead, use a JOIN
. Assuming id
is unique:
UPDATE inventory i JOIN
(SELECT i2.id
FROM inventory i2
WHERE i2.collection_name NOT IN ('C1', 'C2', 'C3', 'C4')
) i2
ON i.id = i2.id
SET i.price = '450' ;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…