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