Two tables Album (AlbumId, Title, ArtistID) and Artist (ArtistId and Name) are given.
SELECT ARTISTID FROM ALBUMS GROUP BY ARTISTID HAVING COUNT(ARTISTID)
CodePudding user response:
Keep in mind that HAVING COUNT
is used to:
The MySQL HAVING clause is used in combination with the GROUP BY clause to restrict the groups of returned rows to only those whose the condition is TRUE. Check to learn about
HAVING COUNT
clause: