Sqlite如果插入或更新数据库

我们经常会用到如果数据库存在则更新,如果不存在则新增 
 

sql一般写为

if exists(select * from table where tableid=1)
insert into table ...
else
update table ....

但是sqlite里没有if exists这种写法,它用的是一种更简单的语句

insert or replace into Forum(forumid,forumname,typeid,forumurl) values(1,'db',2,'http://www.db.com')

相关文章

SQLite架构简单,又有Json计算能力,有时会承担Json文件/RES...
使用Python操作内置数据库SQLite以及MySQL数据库。
破解微信数据库密码,用python导出微信聊天记录
(Unity)SQLite 是一个软件库,实现了自给自足的、无服务器...
安卓开发,利用SQLite实现登陆注册功能