I have a mysql InnoDB table with the following structure:
id artist_id
There are many entries, most artist_ids are there 15 times. But some of them are there only twice. I need to get them.
I came up with the following, to no avail:
SELECT artist_id FROM matches HAVING COUNT(artist_id)=2
It returns 0 rows, although there are artist_ids that only appear in the table twice. How can I get them?
source share