Can I execute multiple UPDATE commands in a single SQL Query?
Posted on 2009-05-05
I have a MySQL table for which I would like to update several lines on a single update. This would be:
UPDATE myTable SET Field1='A' WHERE Field2 like '123' and MyID = 0;
UPDATE myTable SET Field1='B' WHERE Field2 like '123' and MyID = 1;
Can this be done in a single SQL query in MySQL 5.0? (I actually need to execute 20 each time!)
Any help would be appreciated.