+ 1
It is possible to update multiple columns by just separating the SET clause with a comma ( , ) and using IN for multiple rows. For example: UPDATE table SET Name = John , Age = 18 WHERE Id IN (1,2,3,6,19,21); You can also use relational operators like:- <> != This query updates the table with the data provided where the Id is 1,2,3,6,19,21! Hope it helped!
29th Apr 2018, 8:44 AM
Jemuel Stanley
Jemuel Stanley - avatar
+ 1
The where clause could also be something like WHERE Age >= 18 and it would affect multiple rows.
29th Apr 2018, 9:29 AM
Adam
Adam - avatar
+ 1
Correct.
29th Apr 2018, 10:01 AM
Adam
Adam - avatar
0
UPDATE `Employees` SET `LastName` = 'Smith', `Salary` = 55000 WHERE `ID` IN (1,3);
29th Apr 2018, 9:39 AM
Adam
Adam - avatar
0
ideally any change would come from a form. usually that would only be editing one of them at a time. You could have a big table and edit s bunch of rows and submit all of that and there are ways to write a loop to go through all of the submitted data so you only need the one query.
29th Apr 2018, 3:01 PM
Adam
Adam - avatar