I have a Students table which includes the fields FamilyCode and StudentKey. I need to be able to count the number of families that have one student, two students, three students and more than three students. It doesn't sound too hard, but I'm stuck. Any ideas?
Try - <br>
<br>
SELECT A.NUMSTD,COUNT(A.FAMILY) FROM (<br>
SELECT FAMILY, COUNT(STUDENTID) AS NUMSTD FROM<br>
STUDENTTABLE GROUP BY FAMILY) A<br>
GROUP BY A.NUMSTD<br>
<br>
<br>
This should work<br>
<br>
Cal<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.