请教sqlite on conflict 的语法

zealotll 2011-07-03 04:09:49
请假一下大家的语法,sqlite上说on conflict 的语法是这样:

ON CONFLICT子句
conflict-clause ::= ON CONFLICT conflict-algorithm
conflict-algorithm ::= ROLLBACK | ABORT | FAIL | IGNORE | REPLACE

我的sql语句是这样:

insert [or (exists(select * from stuff where ID=0)) ignore ] into [stuff] (ID, name, name1, name2) values (0,"text", null, null);

然后报有语法错误。

我的意图是,当 table stuff 里面有ID=0的记录的时候就插入,否则什么也不干。。
求大家给出正确的写法~~

...全文
256 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧