用了个case when,如何总报invalid relational operator的异常
用了个case when,怎么总报invalid relational operator的错误sql 如下SQL codeselect(case when t.C810000
用了个case when,怎么总报invalid relational operator的错误
sql 如下
SQL codeselect(case when t.C810000005 when '查询' then t.C800010007 when '专题' then t.C800010009 when '资源' then t.C800010016 else 0 end) as 反馈次数 from aaa
[解决办法]select case when t.C810000005 = '查询' then t.C800010007
when t.C810000005 = '专题' then t.C800010009
when t.C810000005 = '资源' then t.C800010016
else 0 end as 反馈次数
from aaa
[解决办法]前面多写了一个when,case t.C810000005
SQL codeselect(case t.C810000005 when '查询' then t.C800010007 when '专题' then t.C800010009 when '资源' then t.C800010016 else 0 end) as 反馈次数 from aaa