日期:2014-05-18  浏览次数:20520 次

急求SQL语句!!@
用SQL语句实现,查询数据库中重复的记录,怎么能查询出来?

------解决方案--------------------
select 字段,count(*) from 表 group by 字段 having count(*)> '1 '
------解决方案--------------------
如果查全部记录.假设重复记录字段为ID
select * from tb where id in (select id from tb group by id having count(*)> 1)
------解决方案--------------------
一楼正解:select 字段,count(*) from 表 group by 字段 having count(*)> 1