You don't need Distinct, you need the Group By clause. It would be something like:
select state,count(*) as 'Cnt' from orders group by state
HTH.
>I need to run an SQL SELECT to do a histogram.... for example, the number of orders in each state:
>
>NJ 456
>AZ 2212
>CA 12
>MN 334
>
>I know the SQL involves the DISTINCT option and the COUNT( ) function... can't seem to find the example I had from a few years ago... can anyone help?
>
>Thanks!
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao