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.
这里有什么问题?
Possible Duplicate:
ora-00979 not a GROUP BY expression
I wrote a query like this:
select employeeid,presenttime,count(latitude)
from mobilelocation
where presentdate='9-11-2011'
group by employeeid
order by presenttime desc
Upon executing this above query its showing the error message like this:
ORA-00979: not a GROUP BY expression.
What is the problem here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是
presenttime
在select
子句中没有聚合函数,但在group by
子句中却没有。这实际上没有意义:引擎应该如何聚合presenttime
?如果不应该,它如何聚合纬度
?The problem is that you have
presenttime
without an aggregate function in theselect
clause but not in thegroup by
clause. This doesn't really make sense: how should the engine aggregatepresenttime
? If it should not, how can it aggregatelatitude
?