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: Phil Turgeon <phitur_at_hotmail.com>
Date: Tue, 20 May 2003 00:06:22 GMT
Message-ID: <Xns9380CC6238E42phiturhotmailcom@205.237.233.52>


Group by state

instead of - where state='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 - 19:06:22 CDT

Original text of this message

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