case 表达式的 sqlite 语法错误
sqlite syntax error with case expression
我写了一个查询
SELECT
case when "Whether you like it or not" = 1
then 'I like it'
from myrestaurants;"
sqlite 说
错误:"from" 附近:语法错误
我尝试了 case 语句的不同组合,但其中 none 有效。
假设 "Whether you like it or not"
是一个包含整数的列,那么您的所有查询都缺少 case
表达式中的 end
:
select case when "Whether you like it or not" = 1 then 'I like it' end
from myrestaurants
我写了一个查询
SELECT case when "Whether you like it or not" = 1 then 'I like it' from myrestaurants;"
sqlite 说 错误:"from" 附近:语法错误 我尝试了 case 语句的不同组合,但其中 none 有效。
假设 "Whether you like it or not"
是一个包含整数的列,那么您的所有查询都缺少 case
表达式中的 end
:
select case when "Whether you like it or not" = 1 then 'I like it' end
from myrestaurants