MySql's UPDATE does not support updating multiple rows with one query. As far as I know there are 2 ways to do so:
INSERT INTO... ON DUPLICATE KEY UPDATE, and using CASE... WHEN...
I'm leaning on using the INSERT/UPDATE as the class will only be called when there is an existing id (or ids) already in the table. Is there a reason I should not use INSERT/UPDATE to update specific fields for multiple rows at one time? Is there an advantage using the CASE WHEN method, instead (ie: faster execution)?
Thanks.
INSERT INTO... ON DUPLICATE KEY UPDATE, and using CASE... WHEN...
I'm leaning on using the INSERT/UPDATE as the class will only be called when there is an existing id (or ids) already in the table. Is there a reason I should not use INSERT/UPDATE to update specific fields for multiple rows at one time? Is there an advantage using the CASE WHEN method, instead (ie: faster execution)?
Thanks.