mahmoud saied
posted
7 posts
since
Mar 01, 2006
from
|
|
Re: Calculate number of employee
|
|
|
|
|
|
|
|
|
|
Hi
You can try this:
SELECT DISTINCT EMPName FROM TABLE WHERE Dept LIKE 'X';
|
|
|
|
|
|
Deepak Dwij
posted
145 posts
since
Oct 17, 2011
from
Delhi NCR
|
|
Re: Calculate number of employee
|
|
|
|
|
|
|
|
|
|
Vineet here is your answer:
create table record ( ID int , EMPName varchar(25), Dept varchar(20), Sal int )

Select Dept,count(*) as NumberOfEmployee from record group by Dept;

|
|
|
|
|
|
Vineet Kumar Saini
posted
376 posts
since
Oct 17, 2011
from
Kashipur, Uttrakhand
|
|
Re: Calculate number of employee
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Satyapriya Nayak
posted
2264 posts
since
Mar 24, 2010
from
|
|
Re: Calculate number of employee
|
|
|
|
|
|
|
|
|
|
|
Hi Vineet,
SELECT Dept, COUNT(*) AS ' Number of employees' FROM employee GROUP BY Dept ORDER BY Dept DESC
Thanks
|
|
|
|
|
|