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.

Last updated 22 May 2024