At the moment I have this
SELECT
COUNT (enrollment_id) AS enrollments,
COUNT (result) AS
MAX (result) AS highest_result,
AVG (result) AS average_result,
MIN (period_code) AS earliest_enrollment
FROM
enrollment
WHERE
result IS NULL
What I want to have is the number of enrollments in total, which is what COUNT(enrollment_id)
is for. I then want to count the number of NULL
values in the results column to obtain a column for unfinalised_enrollments
.
Will the WHERE
clause at the bottom affect the other SELECT
statements that use the results column? If so how do I make it so that I can COUNT just the number of NULL
values in the results column and display it in a column called unfinalised_enrollment
.
thanks in advance.