i have done a attendance table with columns as follows:
where is present is of boolean datatype.
i want to retrieve all the rows whose attendance is less than 75%.
using avg() function it lists each students avg but how to retrieve the details of students whose avg() is less than a particular value.
I am new to sql and I seriously need help.
Thanks in advance.
You can use
SELECT usn, name, AVG(ispresent) attendance FROM table GROUP BY usn, name HAVING attendance < 0.75;