Du kan udføre én UPDATE
med brug af IF
(som mysql understøtter ) eller ved at bruge CASE
for at gøre det mere RDBMS-venligt.
UPDATE example
SET def = IF(abc = 1, 'foo', 'bar')
WHERE abc IN (1, 2) -- reason to make it more faster, doesn't go on all records
ELLER
UPDATE example
SET def = CASE WHEN abc = 1 THEN 'foo' ELSE 'bar' END
WHERE abc IN (1, 2) -- reason to make it more faster, doesn't go on all records