UPDATE site
SET display_order = CASE id
WHEN 1 THEN 1
WHEN 2 THEN 2
WHEN 3 THEN 3
END,
name = CASE id
WHEN 1 THEN 'name 1'
WHEN 2 THEN 'name 2'
WHEN 3 THEN 'name 3'
END
WHERE id IN (1,2,3)
UPDATE site
SET display_order = CASE id
WHEN 1 THEN 1
WHEN 2 THEN 2
WHEN 3 THEN 3
END,
name = CASE id
WHEN 1 THEN 'name 1'
WHEN 2 THEN 'name 2'
WHEN 3 THEN 'name 3'
END
WHERE id IN (1,2,3)
本文标题:MySql 高性能 Update 语句
本文链接:https://www.haomeiwen.com/subject/eimtpltx.html
网友评论