2015-07-22 38 views
-4

在此,我得到一个错误ERROR位于第1行:ORA-00937:不是单组分组函数

ERROR位于第1行: ORA-00937:不是单组分组函数。

有人可以帮助我对此我不熟悉sql

select cerps_accnt_code, cost_centre, SUM(TOTAL_AMOUNT_DUE) 
from globe_billing_report where tag like '%Duncan%' 
+0

检查这些:http://stackoverflow.com /搜索q = [预言] +未+ A +单组+组+功能 –

回答

0

使用Group by同时使用聚合函数sql

select cerps_accnt_code, cost_centre, SUM(TOTAL_AMOUNT_DUE) 
from globe_billing_report 
where tag like '%Duncan%' 
group by cerps_accnt_code, cost_centre 

http://www.w3schools.com/sql/sql_functions.asp

0

尝试添加group by条款如下

select cerps_accnt_code, cost_centre, SUM(TOTAL_AMOUNT_DUE) 
from globe_billing_report 
where tag like '%Duncan%' 
group by cerps_accnt_code, cost_centre 
+0

谢谢你的快速回答!它工作正常! – alkatraz

+0

@alkatraz我很高兴我能帮上忙。不要忘记接受解决问题的答案。 – Parado