Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Simple Query [Q]

Simple Query [Q]

From: Kan Chun Kin <ckkan_at_cs.hku.hk>
Date: 1997/05/13
Message-ID: <5l9ol1$oqt$1@infosite.cs.hku.hk>#1/1

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 :>

Received on Tue May 13 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US