Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00121732
Message ID:
00121746
Vues:
12
>I've got a long program with a lot of scanning and counting to make a report. I'm wondering if it's possible to do the same thing in SQL.
>
>I have a table that includes two fields: Class and Zone. For each unique value of Zone, I want a count of how many of each type of class are in that zone.
>
>Say there's 3 zones: 1,2,3. Two classes: A,B.
>
>I want to know how many times for
>1,A
>1,B
>2,A
>etc.
>
>So I'll know Zone 1 had 6 of Class A.
>
>Can this be done in SQL?
>
>Thanks,
>
>-Michelle

Michelle,
SELECT Zone, Class, COUNT(Class) ;
  FROM MyTable ;
 GROUP BY Class ;
 ORDER BY Zone, Class ;
 INTO CURSOR MyResult
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform