From: Daevid Vincent Date: March 18 2006 11:39pm Subject: RE: Update Multiple Records List-Archive: http://lists.mysql.com/mysql/195948 Message-Id: <003301c64ae5$36dd5940$1301a8c0@locutus> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit update myTable set status = 'completed' where id IN (10,20,30,40,50) LIMIT 5; I believe that should work. As a precaution, I recommend always using "LIMIT x" whenever possible on SELECT, UPDATE or DELETE statements. This will minimize any accidental dammage to other records should you have mistyped a query. Plus it will speed up your SELECTS if you only need to pull 1 record say. > -----Original Message----- > From: Rich [mailto:lists@stripped] > Sent: Saturday, March 18, 2006 3:29 PM > To: mysql@stripped > Subject: Update Multiple Records > > Hi folks. > > I want to set the status of 5 records to 'completed'. how do > I go about > that without having to prepare 5 different instructions? > > "update myTable set status = 'completed' where id=10 OR id=20 > OR id=30 > OR id=40 OR id=50" > > I'm trying to reduce the number of instructions. > > Cheers > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/mysql?unsub=daevid@stripped > >