3
我無法讓我的數據庫保持組織狀態我想設置爲INT PRIMARY KEY AUTO_INCREMENT
的ID字段保持數字順序。當我刪除數據庫中的所有條目時,問題就來了。在刪除條目之前,所有的操作都是按照預期的順序進行的,在刪除之後,而不是按照數字順序進行操作,先從較小的整數開始,然後按降序排列。有人可以解釋是什麼造成了這一點。MySQL ID 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 |
+----+------------+----------+---------+----------------+-----------+------------+-----------+---------+