比如重复字段是 A 表 的 name 字段
select name from A group by name having count(name)>1
显示的就是 重复数 大于 1 的 name了
如果你要查看重复的数据 外面就加个 in name
select * from A where name in(
select name from A group by name having count(name)>1
)
select 字段1,字段2,字段3 from 表名 group by 字段1,字段2,字段3 having count(*)>1
select * from (
select count(A) as num , A from table1 group by A
) bb
where num >1
其中A为你要统计的字段。
SELECT COUNT(*) AS 重复条数,
COLUMN1,COLUMN2,COLUMN3,COLUMN4
FROM table1
GROUP BY COLUMN1,COLUMN2,COLUMN3,COLUMN4
having count(*)>1
大方的