Display column values which occur N times

from the Artful Common Queries page


SELECT id
FROM tbl
GROUP BY id
HAVING COUNT(*) = N;
Change the HAVING condition to >1 to list duplicate values, etc.

Return to the Artful Common Queries page