Sqlite 清空表中所有数据 并重置自增长数据 以及获取last_insert_id的方法

来源:互联网 发布:超易药品进销存软件 编辑:程序博客网 时间:2024/04/29 16:01

1、问:如何清空表中所有数据 并重置自增长数据?
答:

delete from 表名; select * from sqlite_sequence;         找到上面的 表名 update sqlite_sequence set seq=0 where name='表名';

2、问:如何获取类似mysql里的 mysql_insert_id?
答:

select last_insert_rowid() as id from '表名'
0 0