| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Simple Query [Q]
hi,
how can i find the deptno that contains most staff and the number of staff in that dept from the following relation by a single query in sqlplus ?
staff deptno
------ --------
staff1 d1 staff2 d1 staff3 d2 staff4 d2 staff5 d2 staff6 d3 staff7 d3 staff8 d3 staff9 d4
so sqlplus would return
deptno no of staff ------- ------------ d2 3 d3 3
thx for help :>
![]() |
![]() |