2011-11-13 67 views
0

可能重複:
ora-00979 not a GROUP BY expression問題與Oracle查詢

我寫這樣的查詢:

select employeeid,presenttime,count(latitude) 
from mobilelocation 
where presentdate='9-11-2011' 
group by employeeid 
order by presenttime desc 

在執行此上面的查詢其示出像錯誤消息這個:

ORA-00979: not a GROUP BY expression. 

這裏有什麼問題?

回答

1

問題是您的presenttimeselect子句中沒有聚合函數,但沒有group by子句中的聚合函數。這沒有任何意義:發動機應如何彙總presenttime?如果它不應該,它怎麼能聚合latitude