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 |
Your question is unclear.
If necessary, you can do this:
This will increment a column in a ACID compliant manner.