hi friends please answer this question ASAP:-
how to count the no. of employee in a each department
or
no. of employee in each location by using emp/dept table

Answer Posted / madhu sudhan g

Hiii

Try this query it will give you the answer


select count(1) as EmpCount,EmployeeName from EMP
GROUP BY DepartmentName

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of indexing?

606


Where sql server usernames and passwords are stored in a sql server?

503


What is a non clustered primary key?

523


How do you rebuild an identity column?

559


How to achieve Paging of records in SQL SERVER?

599






How do you implement session management in SQL Server mode?

566


Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...

1585


What is sql server programming?

565


How to use user defined functions in expressions?

556


Is foreign key unique?

584


What is spid in sql server profiler?

550


Is sql server a database?

543


What is clustered vs nonclustered index?

514


What are locks in sql?

547


What is resource governor?

560