Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 What is wrong with this?

Author  Topic 

nygfan8
Starting Member

2 Posts

Posted - 2012-04-24 : 18:26:41
SELECT department_id, count last_name
FROM employees;

Please help Im getting an this error
ORA-00937: not a single-group group function

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-04-24 : 18:30:14
1. Count() is an aggregate function requiring parentheses.
2. If you use an aggregate function with non-aggregated columns, you must include the non-aggregates in a GROUP BY clause:
SELECT department_id, count(last_name)
FROM employees
GROUP BY department_id;
3. SQLTeam is Microsoft SQL Server website, we don't handle Oracle questions. Try http://dbforums.com/ instead.
Go to Top of Page

nygfan8
Starting Member

2 Posts

Posted - 2012-04-24 : 18:37:07
Thank you will try this and go to the db website
Go to Top of Page
   

- Advertisement -