Update multiple lines

How to update multiple rows using id as primary key in single query table

I have id id 23,25,26. I need to update the todo_deleted column as noted for all three rows with ids 23,25,26

I need a request that needs to be very efficient. Post ans if u know .. Thanx in advance

+4
source share
2 answers

Similarly, using IN :

  UPDATE `myTable` SET `todo_deleted` = 1 WHERE `id` IN (23, 25, 26) 
+5
source
 UPDATE TABLE SET COLUMN = NEW VALUE WHERE ID IN ( 23, 25 ,26 ) 
+4
source

All Articles