Update multiples rows with different ID at the same time

Keywords´╝Ü mysql sql database mariadb

Question: 

is it possible to do something like this?

update table set field ='text' where ID=1 and ID=3 and ID=5

I executed it but no row is updated.

Answers: 

You need IN rather than AND :

update table set field ='text' where ID IN (1, 3, 5)

You can use IN after WHERE like below,

update table set field ='text' where ID in (1, 3, 5)