Update multiple rows with different values in a single query - MySQL?

Set title equal to itself when you don't want to update it to a different value 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' ELSE title END WHERE id IN (1,2,3).

Set title equal to itself when you don't want to update it to a different value. 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' ELSE title END WHERE id IN (1,2,3).

Thanks! Looks simple and right to me. – Hakan Oct 13 at 19:58.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions