MySQL Forums
Forum List  »  Newbie

Re: Increment Function
Posted by: Felix Geerinckx
Date: April 28, 2005 01:42AM

Ian Biner wrote:

> Is there an SQL function that simply allows me to increment a numeric field (not auto-increment...
> this is a counter, not a record number)?

What about

UPDATE foo SET counter = counter+1 WHERE id = <some_id>;

--
felix

Options: ReplyQuote


Subject
Written By
Posted
April 27, 2005 04:52PM
Re: Increment Function
April 28, 2005 01:42AM
April 28, 2005 07:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.