小编Beh*_*m-s的帖子

SQLite中的IF语句:更新还是插入?

我无法使用SQLite运行此查询

if 0<(select COUNT(*) from Repetition where (Word='behnam' and Topic='mine'))
begin
 update Repetition set Counts=1+ (select Counts from Repetition where (Word='behnam' and Topic='mine'))
end
else
begin
    insert Repetition(Word,Topic,Counts)values('behnam','mine',1)
end
Run Code Online (Sandbox Code Playgroud)

它说"IF附近的语法错误"如何解决问题

sql sqlite if-statement upsert

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

if-statement ×1

sql ×1

sqlite ×1

upsert ×1