Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Statement
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
![]() |
![]() |