Increment a column value - Mysql Views : 185
Tagged in : Mysql
0 0
Send mail
Following query will update a column value by incrementing its value by 1

update TABLE set COLUMN=COLUMN+1 where CONDITION.

Example:

update mytable set id=id+1 where user='test'

the above code will increment id field value by 1 which has user as test


This query also works with varchar type fields.
By Guna, On - 2010-09-28



    Login to add Comments .