- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我在 sqlite 中的代码:stmt.execute("如果不存在人员则创建表(姓名文本,ID INTEGER PRIMARY KEY AUTOINCRMENT)");
但是当我在 Navicat 中看到我的表格并且当我想使用它时,它全部为空。我想像整数(1,2,...)一样使用它。我应该怎么办?请帮助我...
最佳答案
一个简单的谷歌查询结果如下:
摘要
The AUTOINCREMENT keyword imposes extra CPU, memory, disk space, and disk I/O overhead and should be avoided if not strictly needed. It is usually not needed.
In SQLite, a column with type INTEGER PRIMARY KEY is an alias for the ROWID (except in WITHOUT ROWID tables) which is always a 64-bit signed integer.
On an INSERT, if the ROWID or INTEGER PRIMARY KEY column is not explicitly given a value, then it will be filled automatically with an unused integer, usually the one more than the largest ROWID currently in use. This is true regardless of whether or not the AUTOINCREMENT keyword is used.
If the AUTOINCREMENT keyword appears after INTEGER PRIMARY KEY, that changes the automatic ROWID assignment algorithm to prevent the reuse of ROWIDs over the lifetime of the database. In other words, the purpose of AUTOINCREMENT is to prevent the reuse of ROWIDs from previously deleted rows.
关于java - 如何在 sqlite 中使用自动增量变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28949689/
我是一名优秀的程序员,十分优秀!