1SELECT username, email, COUNT(*)
2FROM users
3GROUP BY username, email
4HAVING COUNT(*) > 1
5
1SELECT name, COUNT(email)
2FROM users
3GROUP BY email
4HAVING COUNT(email) > 1
1SELECT _column, COUNT(*)
2FROM _table
3GROUP BY _column
4HAVING COUNT(*) > 1
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
1Multiple field=
2SELECT username, email, COUNT(*)
3FROM users
4GROUP BY username, email
5HAVING COUNT(*) > 1
6
7Single field=
8SELECT _column, COUNT(*)
9FROM _table
10GROUP BY _column
11HAVING COUNT(*) > 1