SQL retrieving only rows of a size - TechRepublic
General discussion
July 18, 2006 at 03:45 PM
john.a.wills

SQL retrieving only rows of a size

by john.a.wills . Updated 19 years, 11 months ago

I want to examine the grades of students only if there are at least 10 students in the class. I think I should be able to write something like this, but I get all classes. What am I doing wrong?
select
shrtckn_subj_code,
shrtckn_crse_numb,
shrtckg_grde_code_final
FROM shrtckn LEFT JOIN shrtckg ON shrtckg_pidm = shrtckn_pidm
WHERE (SELECT count(b.shrtckn_pidm) FROM shrtckn b
WHERE b.shrtckn_crn = shrtckn_crn) > 9

This discussion is locked

All Comments