Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 如何通过表达式解析ORA-00979非组_Sql_Oracle_Group By - Fatal编程技术网

Sql 如何通过表达式解析ORA-00979非组

Sql 如何通过表达式解析ORA-00979非组,sql,oracle,group-by,Sql,Oracle,Group By,我通过以下查询获得ORA-00979: select Unit , count(samid_rfpid) , (tcv+tcv_euro) as total from Closerfprfx GROUP BY Unit 这是一种无障碍的交通工具,它是一种全方位的交通工具和一种欧洲交通工具 由j'ai pas le bon affichage制作的quand j'ajute tcv_euro et tcv dans Group: Unit count total CCF 1

我通过以下查询获得ORA-00979:

select Unit , count(samid_rfpid) ,  (tcv+tcv_euro) as total from Closerfprfx GROUP BY Unit
这是一种无障碍的交通工具,它是一种全方位的交通工具和一种欧洲交通工具 由j'ai pas le bon affichage制作的quand j'ajute tcv_euro et tcv dans Group:

 Unit count total
  CCF   1     500
CCF   1     500
CCF   1     500
CCF   1     500
CCF   1     500
正确的显示:

Unit  count    total
CCF   5            56140
请说明如何解决此错误

您需要使用聚合函数:

SELECT UNIT,
       COUNT(SAMID_RFPID),
       SUM(TCV + TCV_EURO) AS TOTAL -- here
  FROM CLOSERFPRFX
 GROUP BY UNIT

这是一个明显的甲骨文错误。sql server标记已删除。堆栈溢出是一个英语社区,请用英语发布您的日志。我有法语,让你的问题不清楚。非常感谢