Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Histogram SQL?
Message
 
 
To
09/12/2000 17:41:19
Rich Lieblich
Infosys Technologies, Inc.
Fanwood, New Jersey, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00451246
Message ID:
00451255
Views:
21
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.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform