mysql 中有行号吗_重置SQLite3 / MySQL中的行号计数
sqlite的
使用:
DELETE FROM your_table;
DELETE FROM sqlite_sequence WHERE name = 'your_table';
sqlite keeps track of the largest ROWID that a table has ever held using the special sqlITE_SEQUENCE table. The sqlITE_SEQUENCE table is created and initialized automatically whenever a normal table that contains an AUTOINCREMENT column is created. The content of the sqlITE_SEQUENCE table can be modified using ordinary UPDATE,INSERT,and DELETE statements. But making modifications to this table will likely perturb the AUTOINCREMENT key generation algorithm. Make sure you know what you are doing before you undertake such changes.
使用:
ALTER TABLE tbl AUTO_INCREMENT = 1;
在這兩種情況下,數(shù)據(jù)庫不關(guān)心ID號是否是順序的 – 只有值是唯一的.如果用戶從未看到主鍵值(他們不應該,因為數(shù)據(jù)可能會改變并不總是在該主鍵值),我不會打擾這些選項.
總結(jié)
以上是生活随笔為你收集整理的mysql 中有行号吗_重置SQLite3 / MySQL中的行号计数的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2019聊大考研计算机调剂,2019年聊
- 下一篇: css 轨道,html-当其他轨道增加时