Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Histogram SQL?
Message
 
 
À
09/12/2000 17:41:19
Rich Lieblich
Infosys Technologies, Inc.
Fanwood, New Jersey, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00451246
Message ID:
00451255
Vues:
22
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform