Re: MySQL Increment/Decrement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ben

It seems that you can just update the column with a update query like this,

update table set field = field + 1 where some condition

This might be the thing you need.


Eric



On 12/29/09, Ben Miller <ben@xxxxxxxxx> wrote:
>
> I hope this isn't a bone-head question - Is there a MySQL query that will
> increment/decrement the value in an integer column with a single query - in
> other words, I don't have to run a SELECT query to get the value,
> add/subtract to/from the value, and then run an UPDATE query to store the
> new value?
>
>
>
> Thanks in advance.
>
>
>
> Ben
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux