>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