ORA-00937:不是单组组功能,计数功能

时间:2015-05-04 17:16:17

标签: oracle count

 select  officer.forename || ' ' || Officer.surname || ' is working on : ' || 
 count(crime.crime_id)  "Officers Current Crimes"

 From officer, crime
 where officer.officer_id = crime.officer_id
 order by crime.crime_id;

任何人都可以告诉我如何解决这个错误,它与count函数有关,提前谢谢。

1 个答案:

答案 0 :(得分:2)

select  officer.forename, Officer.surname || ' is working on : ' || 
 count(crime.crime_id)  "Officers Current Crimes"
 From officer, crime
 where officer.officer_id = crime.officer_id
GROUP BY officer.forename, Officer.surname;

您无法在非分组列上使用ORDER BY ..