sue Posted October 22, 2019 Share Posted October 22, 2019 Hi, I have a query that goes like this SELECT s.studentid, firstname,lastname,dp,startyear,sum(credits) FROM students s, results r, courses c WHERE s.studentid=r.studentid AND r.courseid=c.courseid GROUP BY s.studentid HAVING (dp, startyear) = (SELECT dp, startyear FROM students WHERE studentid=18); I need to filter it so that it only returns those that have credits less than student 18. I am stuck now as to how to do that. Any ideas? Also this one above misses out one record as they have no credits. How could I get it still to display the name etc but the sum to read as 0? Thanks in advance Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now