在表中查找重复行
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在表中查找重复行相关的知识,希望对你有一定的参考价值。
Field1 + Field2 + Field3 should create 1 entry for each unique row in the DB. In an employee table, this would be FirstName + LastName + EmployeeNumber
SELECT * FROM TABLE WHERE field1 + field2 + field3 IN ( SELECT field1 + field2 + field3 FROM TABLE GROUP BY field1 + field2 + field3 HAVING COUNT(*) > 1 ) AND uniqueID NOT IN ( SELECT MAX(uniqueID) FROM xer_regis_new GROUP BY field1 + field2 + field3 HAVING COUNT(*) > 1 )
以上是关于在表中查找重复行的主要内容,如果未能解决你的问题,请参考以下文章