An extension to this Question here, how can I fetch the count for ALL the students who have reached their maximum allowed absents.
I tried this
SELECT COUNT(*) FROM ( SELECT student_id, COUNT(attendance) FROM student_attendance WHERE attendance = 'ABSENT' GROUP BY student_id HAVING COUNT(attendance) = (SELECT max_allowed FROM configurations) ) abc
but it is not working and gives this error:
No column was specified for column 2 of 'abc'.
Environment: SQL Server 2000