首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

用了个case when,如何总报invalid relational operator的异常

2012-09-17 
用了个case when,怎么总报invalid relational operator的错误sql 如下SQL codeselect(case when t.C810000

用了个case when,怎么总报invalid relational operator的错误
sql 如下

SQL code
select(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 code
select(case  t.C810000005 when '查询' then t.C800010007 when '专题' then t.C800010009 when '资源' then t.C800010016 else 0 end) as 反馈次数 from aaa 

热点排行