Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL Count function

Posted on 2011-03-15
5
451 Views
Last Modified: 2012-05-11
I need to come up with Syntax to find the number of employees (Employee.Emp_ID) in each classification EEO1_Classification
0
Comment
Question by:Winstink
5 Comments
 
LVL 9

Expert Comment

by:Roman Gherman
ID: 35141286
Hi,
Could you give more details?

---------------
Find me on: http://extremedev.blogspot.com
0
 
LVL 26

Accepted Solution

by:
Shaun Kline earned 250 total points
ID: 35141291
Select EEO1_Classification, count(*)
from Employee
group by EEO1_Classification
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
ID: 35141310
It sounds like you need a GROUP BY:
SELECT EEO1_Classification, COUNT(1) As Count
FROM Employee
GROUP BY EEO1_Classification

Open in new window

0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 35141321
Awww shucks Shaun_Kline....  you beat me to it  = )
0
 
LVL 7

Expert Comment

by:mmr159
ID: 35141569
One gets points for speed, one for form. :)
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question