I have a table that contains songs ("Tracks" is the name of my table). I can only use this table to retrieve my data.
The table contains a column with the AlbumId. So I am trying to find all the albums in this table that have at least 12 songs.
I use the below code but I get an error message (misuse of aggregate: COUNT()
SELECT
AlbumId,
COUNT(*)
FROM Tracks
WHERE COUNT(*) > 12
GROUP BY AlbumId;
What exactly is wrong with my code and how would I be able to get the data that I want?
Thanks!