Close: MySQL update query to increment specific value
P粉129275658
P粉129275658 2023-09-19 18:36:24
0
1
610

How to increase and update mysql columns with the same value

Id name UpdateA(expected) Update B (expected)
1 AAAAA 1 1
2 AAAAA 1 2
3 AAAAA 1 3
4 BBBBB 2 1
5 BBBBB 2 2
6 CCCCCC 3 1
7 CCCCCC 3 2
8 CCCCCC 3 3
9 CCCCCC 3 4
10 CCCCCC 3 5

P粉129275658
P粉129275658

reply all(1)
P粉105971514

Your question is unclear.

If necessary, you can do this:

UPDATE whatever_table 
   SET column_a = column_a + 1
 WHERE column_name = 'AAAAAA'

This will increment a column in a ACID compliant manner.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template