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 -> Re: SQL Statement

Re: SQL Statement

From: Dirk Tschentscher <dirkremove_at_volksTHISwagen.de>
Date: Mon, 19 May 2003 15:46:36 +0200
Message-ID: <baan5d$6qr7@doiweb4.volkswagen.de>


Hi,

Try
select count(state) sum, state from clients where state in ('CA',...)
group by state;

Rgds

    Dirk
"Henry" <no_at_spam.com> schrieb im Newsbeitrag news:mK4ya.63635$cB3.459568_at_nnrp1.uunet.ca...
> Hi,
>
> I am trying to count number of records containing certain states.
>
> SELECT COUNT(state) from CLIENTS WHERE STATE = 'CA';
>
> However, I am trying to count 5 different states in the same statement, is
> that possible
> to do this?.....first find all the states that I am looking for:
> CA, NY, AZ, MI, FL......then count how many records each state had.
>
> Output would look like this:
>
> CA - 3
> NY - 12
> AZ - 19
> MI - 23
> FL - 1
>
>
> Thanks,
> Henry
>
>
>
>
Received on Mon May 19 2003 - 08:46:36 CDT

Original text of this message

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