UPDATE ae44
SET price =
CASE
WHEN ID = 'AT259793380' THEN
'500'
WHEN ID = 'AT271729590' THEN
'600'
WHEN ID = 'AT275981020' THEN
'700'
END
Bemærk, at denne forespørgsel vil opdatere priserne for posterne med andre id'er til NULL
.
Hvis du kun vil opdatere id'er fra din liste, skal du bruge denne:
UPDATE ae44
JOIN (
SELECT 'AT259793380' AS oldval, '500' AS newval
UNION ALL
SELECT 'AT271729590' AS oldval, '600' AS newval
UNION ALL
SELECT 'AT275981020' AS oldval, '700' AS newval
) q
ON ae44.id = q.oldval
SET price = q.newval