SQLite 设置自增列、重置自增列
创建表
设置主键自增
CREATE TABLE [tCeShi](
[ID] INTEGER PRIMARY KEY AUTOINCREMENT,
[Name] TEXT(50),
[Amount] REAL);
插入数据
主键位置写成NULL
insert into tCeShi values(NULL, '商品A', 10);
或不插入主键
insert into tCeShi(Name, Amount) values('商品B', 20);
重置自增列
查询自增列内部表
select * from sqlite_sequence
重置为空
delete from sqlite_sequence where name = 'tCeShi'
或设为指定值
update sqlite_sequence set seq = 100 where name = 'tCeShi'