查找/删除重复记录

查找相当记录及个数:

SELECT COUNT(CNAME),CNAME FROM tblCompany GROUP BY CNAME HAVING (COUNT(*) > 1)

 

删除相当记录:

delete tblCompanyTemp where ID not in (
select max(ID) from tblCompanyTemp group by CNAME)

posted @ 2011-06-08 16:32  草根站长李小冲  阅读(154)  评论(0编辑  收藏  举报