我试图获取所有具有重复数据的记录并通过输入序列号来更新它。
假设我有这些数据:
+-------------------------------------------+
| first_name | last_name | sequence_number |
+-------------------------------------------+
| John | Smith | NULL |
| John | Smith | NULL |
| Jane | Doe | NULL |
| Jane | Doe | NULL |
| Jane | Doe | NULL |
| Rock | Lee | NULL |
+-------------------------------------------+
我的预期输出是这样的:
+-------------------------------------------+
| first_name | last_name | sequence_number |
+-------------------------------------------+
| John | Smith | 1 |
| John | Smith | 2 |
| Jane | Doe | 1 |
| Jane | Doe | 2 |
| Jane | Doe | 3 |
| Rock | Lee | NULL |
+-------------------------------------------+