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

SQL Statement

From: Henry <no_at_spam.com>
Date: Mon, 19 May 2003 10:14:53 -0300
Message-ID: <mK4ya.63635$cB3.459568@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:14:53 CDT

Original text of this message

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