就在之前,我发布了一个关于为列中的每个重复值获取计数器的问题
现在我将扩展这个问题,例如:
+------+------+------+
| id | data | num |
+------+------+------+
| 1 | a | |
| 2 | a | |
| 3 | a | |
| 4 | b | |
| 5 | b | |
| 6 | c | |
| 7 | d | |
| 8 | a | |
| 9 | b | |
+------+------+------+
可以更新为:
+------+------+------+
| id | data | num |
+------+------+------+
| 1 | a | a1 |
| 2 | a | a2 |
| 3 | a | a3 |
| 4 | b | b1 |
| 5 | b | b2 |
| 6 | c | c1 |
| 7 | d | d1 |
| 8 | a | a4 |
| 9 | b | b3 |
+------+------+------+
无论如何,向蓝脚鞠躬!