我无法让我的数据库保持井井有条 我希望设置为 an 的 ID 字段INT PRIMARY KEY AUTO_INCREMENT
保持数字顺序。当我删除数据库中的所有条目时,问题就来了。在删除条目之前,一切都按预期顺序排列,在删除而不是按数字顺序从较小的整数开始后,它将始终按降序排列。有人可以解释是什么原因造成的。
+----+------------+----------+---------+----------------+-----------+------------+-----------+---------+
| id | employeeID | date | timeIn | jobDescription | equipType | unitNumber | unitHours | timeOut |
+----+------------+----------+---------+----------------+-----------+------------+-----------+---------+
| 1 | 2 | 01/13/13 | 1:19 pm | Test1 | Dozer | 1D | 98 | 1:20 pm |
| 2 | 2 | 01/13/13 | 1:20 pm | Test2 | Dozer | 1D | 98 | 1:20 pm |
+----+------------+----------+---------+----------------+-----------+------------+-----------+---------+
删除所有行后:
+----+------------+----------+---------+----------------+-----------+------------+-----------+---------+
| id | employeeID | date | timeIn | jobDescription | equipType | unitNumber | unitHours | timeOut |
+----+------------+----------+---------+----------------+-----------+------------+-----------+---------+
| 4 | 2 | 01/13/13 | 1:22 pm | Test2 | Dozer | 1D | 98 | 1:22 pm |
| 3 | 2 | 01/13/13 | 1:22 pm | Test1 | Dozer | 1D | 98 | 1:22 pm |
+----+------------+----------+---------+----------------+-----------+------------+-----------+---------+