But if we want to perform the same operation using the HAVING
clause, we'd switch it up like this.
To use the HAVING
clause, we first have to form a grouping, and then apply the condition.
xxxxxxxxxx
SELECT studentname,
Sum(attendance) AS TotalAttendance
FROM class
GROUP BY studentname
HAVING totalattendance > 80
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment