开发者

What is wrong with this SQLite3 statement?

开发者 https://www.devze.com 2023-01-20 20:08 出处:网络
I have written this SQLite statement and I am getting syntax error on the following line: update List SET number = (CASE WHEN number>=3 then number++ WHEN number=1 the开发者_如何转开发n 3 ELSE num

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

update List SET number = (CASE WHEN number>=3 then number++ WHEN number=1 the开发者_如何转开发n 3 ELSE number END) WHERE listKey=3;

The error is:

SQL error: near "WHEN": syntax error

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消