何校萍

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

1、查找表中重复记录,根据单个字段来判断

Select * from tableA where peopleId in(select peopleId from tableA group by peopleI having count (peopleId)>1)

2、查找表中重复记录,根据多个字段判断

Select * from tableA as A where (A.peopleId,A.seq) in (select peopleId,seq from tableA group by peopleId,seq having count (*)>1)

 

posted on 2017-11-09 18:15  何校萍  阅读(206)  评论(0编辑  收藏  举报