I am using oracle 10g and wrote a query like this:
SELECT presenttime,
employeeid
FROM mobilelocation
WHERE presentdate = '31-10-2011'
GROUP BY employeeid;
resulting an error message
ORA-00979: not a GROUP BY expression
But upon removing this group clause returining the result without any errors like this,
PRESENTTIME EMPLOYEEID
23:25 12304
23:48 12305
What is the problem with my group by clause and also suggest me how to use order by clause also
GROUP BYimplies that you want to aggregate multiple rows from the table into a single row for everyEmployeeIDvalue. If that is your goal, you’d need to specify an aggregate function on the columns that you are not grouping by. If you want the earliestPresentTimevalue for eachEmployeeID, for example, you’d do something like