U kunt één UPDATE
. uitvoeren met behulp van IF
(die mysql ondersteunt ) of door CASE
. te gebruiken om het RDBMS-vriendelijker te maken.
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
OF
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