will41 Posted August 31, 2011 Share Posted August 31, 2011 hi how is everyone today? this is my first post i have a table that has 4 columns id formation type image path what i need is to update sevral rows for the type when it matches the id i have tried update set type = 2 where id = 2 and id = 4 that didnt work tried update set type = 2 where id = 2,4 that did not work tried UPDATE `plays` SET `type`= CASE WHEN `id`=2 THEN `type` = 2 WHEN `id`=4 THEN `type` = 2 ELSE THEN `type' END WHERE `ID` IS NOT NULL did not work Can someone help me with this thanks wil41 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 31, 2011 Share Posted August 31, 2011 update your_table set type = 2 where id = 2 or id = 4 or update your_table set type = 2 where id in(2,4) Quote Link to comment Share on other sites More sharing options...
will41 Posted August 31, 2011 Author Share Posted August 31, 2011 thanks so much that woked like a charm Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.