Is it possible to perform multiple updates with a single UPDATE SQL statement?
问题 Let's say I have a table tbl with columns id and title . I need to change all values of title column: from 'a-1' to 'a1', from 'a.1' to 'a1', from 'b-1' to 'b1', from 'b.1' to 'b1'. Right now, I'm performing two UPDATE statements: UPDATE tbl SET title='a1' WHERE title IN ('a-1', 'a.1') UPDATE tbl SET title='b1' WHERE title IN ('b-1', 'b.1') This isn't at all a problem, if the table is small, and the single statement completes in less than a second and you only need a few statements to execute