1CREATE table `duplicat` LIKE `orginal`;
2INSERT `duplicat` SELECT * FROM `orginal`;
1SELECT
2 col1, COUNT(col1),
3 col2, COUNT(col2)
4FROM
5 table_name
6GROUP BY
7 col1,
8 col2
9HAVING
10 (COUNT(col1) > 1) AND
11 (COUNT(col2) > 1);
12
1
2
3
4
5 SELECT
6 col,
7 COUNT(col)
8FROM
9 table_name
10GROUP BY col
11HAVING COUNT(col) > 1;
12Code language: SQL (Structured Query Language) (sql)
1SELECT firstname,
2 lastname,
3 list.address
4FROM list
5 INNER JOIN (SELECT address
6 FROM list
7 GROUP BY address
8 HAVING COUNT(id) > 1) dup
9 ON list.address = dup.address;
10