这个SQLite3语句有什么问题吗?

时间:2021-07-05 15:41:35

I have written this SQLite statement and I am getting syntax error on the following line:

我已经写了这个SQLite语句,我在下面的行中得到了语法错误:

update List SET number = (CASE WHEN number>=3 then number++ WHEN number=1 then 3 ELSE number END) WHERE listKey=3;

The error is:

错误的是:

SQL error: near "WHEN": syntax error

SQL错误:接近“WHEN”:语法错误

I tried various versions, adding braces at places and all, but can't figure out the error. Can anyone please help me with this?

我尝试了各种不同的版本,在不同的地方添加了大括号,但是不能找出错误。谁能帮我一下吗?

1 个解决方案

#1


4  

If SQLite uses "++" syntax, I've never seen it. Try then number + 1 instead.

如果SQLite使用“++”语法,我从未见过。试试数字+ 1。

#1


4  

If SQLite uses "++" syntax, I've never seen it. Try then number + 1 instead.

如果SQLite使用“++”语法,我从未见过。试试数字+ 1。