1

I want to increment a field value by (+1) in every row of mysql table.

How to do that using mysql or phpmyadmin?

Shadow
  • 33,525
  • 10
  • 51
  • 64
Mr. Shrestha
  • 102
  • 2
  • 9
  • Just once or do you want to increment more than once? – Matt Mar 14 '17 at 15:46
  • 1
    Possible duplicate of [Increment value in mysql update query](http://stackoverflow.com/questions/2259155/increment-value-in-mysql-update-query) – Shadow Mar 14 '17 at 15:58

2 Answers2

6
update my_table set my_field = my_field+1
Ofir Winegarten
  • 9,215
  • 2
  • 21
  • 27
5

You can use an update eg:

update my_table  
set my_column  = my_column +1
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107