I'm stuck to this error:
Msg 8120, Level 16, State 1, Line 2 Column 'Subjects.off_CODE' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
I don't know what is wrong with this query.
use Enlistment
go
SELECT Subjects.off_CODE, Subjects.subj_CODE, Subjects.description,
Subjects.unit, COUNT(Enlistment.off_CODE) FROM Enlistment, Subjects
WHERE Subjects.off_CODE = 11315
GROUP BY Enlistment.off_CODE