faqts : Computers : Databases : MySQL

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

15 of 29 people (52%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

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

Feb 22nd, 2008 20:21
dman, Euan MacInnes, Stephen Haynes, http://sturly.com


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.