ORA-00937: 不是单组分组函数

缺少了分组条件

比如

SELECT teller_code,(select xm from sys_dict_ggczy d where d.czy=a.teller_code ) as teller_name,
SUM(TRX_NUM) SUM_TRX_NUM,
SUM(OCR_TRX_NUM) SUM_OCR_TRX_NUM,
100*(fun_formatdecstr2(round(to_number(SUM(OCR_TRX_NUM) ,'999999999.000')/ case when SUM(TRX_NUM) = 0 then 1 else SUM(TRX_NUM) end,2))) || '%' sbl
FROM rpt_pvoas_statistic a

就报这个错误,然后添加分组条件就好了

group by teller_code

 

posted @ 2019-03-18 14:06  LOGAN彡  阅读(2851)  评论(0编辑  收藏  举报