Hi. I need some help with a rather complicated query.
I’ve attached the ERD of the database. Now what I would like to do is output the bands that have 2 or more guitarists.
So far I’ve come up with
SELECT Band.Name, COUNT(Member.MemberID) FROM Band, Member WHERE Member.BandID = Band.BandID GROUP BY Band.BandID;
This outputs all the bands and how many members each band has. Now I suppose I have to include HAVING after that and then count how many guitarists each band has. But if I nest a select in the HAVING statement it says that the result returns more than one row, which is pretty logical I suppose.