|
|
Increment a column value - Mysql
|
Views : 185
|
|
Tagged in : Mysql
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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 |
|
|
|