Results 1 to 3 of 3
Apr 15, 2012, 00:12 #1
- Join Date
- Apr 2011
- Mexico city, Mexico
- 1 Post(s)
- 0 Thread(s)
UPDATE multiple rows with different IDs
I am trying to figure out how to run an update to multiple rows by using their ID, for example if I have the following query I am updating based on the state and all matching rows will be affected, but what if I wanted to run that same query but based on IDs
UPDATE sometable SET state = 0 WHERE state = 1
So I want to do something like
UPDATE sometable SET state = 0 WHERE state = 1 AND id = 1
but I want to run the query in multiple items like IDs 1,2,3,4,20,45... etc
Any help is appreciatedDo you get bothered because I do the same thing every day?
Do you question why I do it?
Then find something that you actually like doing!!!
Stop thinking on what I do.