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 -> How to SELECT the COUNT??

How to SELECT the COUNT??

From: Violin <violin.hsiao_at_mail.pouchen.com.tw>
Date: 27 Apr 1999 00:17:17 GMT
Message-ID: <3725d18a.8528533@news.twsc.pouchen.com.tw>


Hello all,
I have a select count question.
If I have a table like this:

EMPNO SAL_TYPE


00001                       A
00002                       A
00003                       B
00004                       A
00005                       B
00006                       B
00007                       A

I want to do a select :
SELECT COUNT(T1.EMPNO) "TYPE_A",

                  COUNT(T2.EMPNO) "TYPE_B"
FROM EMP T1,EMP T2
WHERE T1.SAL_TYPE = 'A' and
                   T2.SAL_TYPE = 'B';

The result like this:
TYPE_A       TYPE_B

---------------------------------
4 3

How to do the SELECT COUNT sql?
Thanks for your tips.

Violin.
violin.hsiao_at_mail.pouchen.com.tw Received on Mon Apr 26 1999 - 19:17:17 CDT

Original text of this message

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