We have “DISTINCT” to select unique entries, but what about duplicates? Here’s how:
SELECT email,
COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )
Use advanced navigation for a better experience.
You can quickly scroll through posts by pressing the above keyboard keys. Now press Esc to close this window.
We have “DISTINCT” to select unique entries, but what about duplicates? Here’s how:
SELECT email,
COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )