Update multiple rows with different values in a single query - MySQL
问题 I'm new to MySQL. I'm using this to update multiple rows with different values, in a single query: UPDATE categories SET order = CASE id WHEN 1 THEN 3 WHEN 2 THEN 4 WHEN 3 THEN 5 END, title = CASE id WHEN 1 THEN 'New Title 1' WHEN 2 THEN 'New Title 2' WHEN 3 THEN 'New Title 3' END WHERE id IN (1,2,3) I am using "WHERE" to improve performance (without it every row in the table would be tested). But what if I have this senario (when I don't want to update title for id 2 and 3): UPDATE