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