2012年10月21日

sql 查出一张表中重复的所有记录数据

摘要: 1、在面试的时候碰到一个 问题,就是让写一张表中有id和name 两个字段,查询出name重复的所有数据,现在列下:select * from xi a where (a.username) in (select username from xi group by username having count(*) > 1)2、查询出所有数据进行分组之后,和重复数据的重复次数的查询数据,先列下:select count(username) as '重复次数',username from xi group by username having count(*)>1 or 阅读全文

posted @ 2012-10-21 22:53 疯狂的石头陈 阅读(2010) 评论(0) 推荐(0) 编辑

导航