frequently ask ? : Computers : Databases : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

14 of 25 people (56%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How can I update more than one record at a time? i.e record 1, 5, 9 Thanks

Sep 13th, 2002 12:29
Euan MacInnes, Stephen Haynes,


Option 1)
update table set field=value where record in (1,5,9)
Option 2)
update table set field=value where record=1 or record=5 or record=9
But Backup the table first, in case you are using a version that has 
bugs in the OR evaluation.