0

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?

Community
  • 1
  • 1
user636207
  • 286
  • 2
  • 6
  • 14

1 Answers1

1

The problem is that you have presenttime without an aggregate function in the select clause but not in the group by clause. This doesn't really make sense: how should the engine aggregate presenttime? If it should not, how can it aggregate latitude?

Mat
  • 202,337
  • 40
  • 393
  • 406