1SELECT username, email, COUNT(*)
2FROM users
3GROUP BY username, email
4HAVING COUNT(*) > 1
5
1SELECT [CaseNumber], COUNT(*) AS Occurrences
2FROM [CaseCountry]
3GROUP BY [CaseNumber]
4HAVING (COUNT(*) > 1)
1/* Gets reps */
2SELECT fieldA, COUNT(*)
3FROM tableA
4GROUP BY fieldA
5HAVING COUNT(*) > 1
6
7/* Use reps to filter results */
8SELECT a.*
9FROM tableA a
10JOIN (
11 SELECT fieldA, COUNT(*) as 'count'
12 FROM tableA
13 GROUP BY fieldA
14 HAVING COUNT(*) > 1
15) b
16ON a.fieldA = b.fieldA
17
1SELECT username, email, COUNT(*)
2FROM users
3GROUP BY username, email
4HAVING COUNT(*) > 1
1• SELECT first_name, COUNT (first_name) FROM employees
2GROUP BY first_name
3HAVING (COUNT(first_name) > 1);