我可以在sqlite中创建这样的语句吗?
update books set (if number_of_pages > 0 then number_of_pages = number_of_pages - 1) where book_id = 10
这有一个有效的语法吗?
CASE语句应使用以下语法:
原文链接:https://www.f2er.com/sqlite/197668.htmlUPDATE books SET number_of_page = CASE WHEN number_of_pages > 0 THEN (number_of_pages - 1) ELSE 0 END WHERE whatever_condition