[thelist] [mysql] multiple update query

kris burford kris at midtempo.net
Wed Mar 10 08:07:40 CST 2004


hi

have a large mysql db to update and want to know whether there is a means 
by which i can write a single sql update statement to update multiple rows.

i.e. i know i can do this:
insert into table (foo, bar) values ('1', '2'), ('3, '4'), ('5', '6');

is there a means i can do something like
update table set (foo='1' where id ='1'), (foo='2' where id='2');

have tried various means with no joy.

many thanks

kris
--
kris burford
midtempo ltd
http://www.midtempo.net



More information about the thelist mailing list