批量修改一个字段的:
UPDATE emp
SET NAME = CASE id
WHEN 1 THEN '222222222'
WHEN 11 THEN '333333333'
WHEN 12 THEN '444444444'
END
WHERE id IN (1,11,12)
批量修改多个字段的:
UPDATE orderform
SET user_name = CASE orderform_id
WHEN 1 THEN 5555
WHEN 2 THEN 6666
WHEN 3 THEN 77777
END,
subbranches = CASE orderform_id
WHEN 1 THEN 'New Title 1'
WHEN 2 THEN 'New Title 2'
WHEN 3 THEN 'New Title 3'
END
WHERE orderform_id IN (1,2,3)