SQL Count function

Posted on 2011-03-15
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
Question by:Winstink

Expert Comment

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

Find me on:
LVL 26

Accepted Solution

Shaun Kline earned 250 total points
ID: 35141291
Select EEO1_Classification, count(*)
from Employee
group by EEO1_Classification
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

LVL 75

Expert Comment

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

Expert Comment

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

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL eating up memory? 16 42
SQL Select Query help 1 38
Specify timing interval fro change data 2 57
Need age at date of document 5 21
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

730 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