如何找到重复的行?

时间:2010-08-13 18:40:54

标签: mysql

我有75000行记录我需要知道有多少重复,我怎么能在MySQL Query中做到这一点?

1 个答案:

答案 0 :(得分:7)

此查询将返回所有重复的行以及它们重复的次数

SELECT Col1, Col2,..ColLast, Count(*) As NumDups FROM YourTable
GROUP BY Col1,Col2,...,ColLast
HAVING COUNT(*) > 1;