作业帮 > 综合 > 作业

oracle报错00936 缺失表达式 错误

来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/06/17 07:25:04
oracle报错00936 缺失表达式 错误
select t.comcode 组代码,
(select y.comcname from cc_company y where y.comcode=t.comcode) 组名称,
sum(decode(aa.a3,0,aa.a1,0)) as 零分总量,
sum(decode(aa.a3,1,aa.a1,0)) as 一分总量,
sum(decode(aa.a3,2,aa.a1,0)) as 二分总量,
sum(decode(aa.a3,3,aa.a1,0)) as 三分总量,
sum(decode(aa.a3,4,aa.a1,0)) as 四分总量,
sum(decode(aa.a3,5,aa.a1,0)) as 五分总量,
sum(decode(aa.a1,'' ,0,aa.a1)) 满意度评价总量,
sum(decode(aa.a4,'',0,aa.a4)) 满意度评价总分
from
(select distinct c.comcode as comcode from cc_company c where 1=1 and c.flag='2' )t ,
(select count(a.result) a1,c.comcode as comcode ,a.result a3,sum(a.result) a4
from cc_tivr_csr a,cc_user b ,cc_company c
where 1=1
and a.agentid = b.usercode
and b.reserve2=c.comcode
and a.result ='F'
and a.result is not null
and c.flag=2 and c.comtype='' group by ,a.result) aa
where t.comcode=aa.comcode(+)
group by t.comcode order by t.comcode
oracle报错00936 缺失表达式 错误
and c.flag=2 and c.comtype='' group by , a.result) aa
group by 后面多了个, 逗号
再问: 不是 去掉之后会报00979 错误
再答: 你得改为
and c.flag=2 and c.comtype='' group by c.comcode, a.result) aa
再问: 你好 我技术一般 能给我讲解下为什么么?详细点哈
再答: 现在应该没报错了吧,你group by要加上没带函数的所有字段,否则就会报00979错误