| List: | General Discussion | « Previous MessageNext Message » | |
| From: | beacker | Date: | March 19 2004 7:07pm |
| Subject: | Re: newbie: increment an existing record | ||
| View as plain text | |||
>> Is there a mysql command that will increment the value of a field in an >> existing row? I would think this would be pretty basic, but I can't seem >> to find anything in the online documentation. > >update t1 set f = f + 1 Unfortunately that will update all the records in the database. It's likely he would prefer to update a particular record via update t1 set f = f + 1 where id = 1234; Which will update only the record matching the id of 1234. Brad Eacker (beacker@stripped)
| Thread | ||
|---|---|---|
| • newbie: increment an existing record | miasmo | 19 Mar |
| • Re: newbie: increment an existing record | Sasha Pachev | 19 Mar |
| • Re: newbie: increment an existing record | beacker | 19 Mar |
| • Re: newbie: increment an existing record | miasmo | 19 Mar |
| • Re: newbie: increment an existing record | Brad Eacker | 19 Mar |
