Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

total count

Status
Not open for further replies.

zik

Technical User
Jan 23, 2006
28
HR
I am trying to get a total count of certain employees.
I am using select colum1..columnN, count(*)
from emp
where empno = P_empno
group by rollup(colum1,columnN)
Say for instance there are 30 employees in dept 10,
I want it like:
ename dept total
king 10 3
Right now I am getting
ename dept total
king 10 3
don 10 1
can anyone help please
zik
 
Come on guys I am sure someone in here can help me.
I just want totals like this:

ename dept total
king 10 5
james 30 10

No sub totals and no grand totals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top