sqlite如何避免重复建表(获取已经存在的表)

找到已经存在的所有表,手动判断是否需要建表

SELECT name FROM SQLITE_MASTER WHERE type='table'ORDER BY name"

建表时sqlite自动判断:
create table if not exists nodetype(id integer PRIMARY KEY autoincrement,type int)

 

删除表示自动判断:

drop table if exists SysNotice

posted @ 2019-01-11 11:37  卡萨丁·周  阅读(1771)  评论(0编辑  收藏  举报