当前位置: 代码迷 >> Sql Server >> 怎么在表中查询有相同列的行?
  详细解决方案

怎么在表中查询有相同列的行?

热度:49   发布时间:2016-04-27 16:27:28.0
如何在表中查询有相同列的行???????
RT

------解决方案--------------------
select * from table where ff in(select ff from table group by ff having(count(*)> 1))
------解决方案--------------------
select col,重复行数=count(*) from tb group by col having count(*)> 1
------解决方案--------------------
select * from t a
left join
(
select id ,count(*) from t group by id having count(*)> 1
)b on a.id=b.id
  相关解决方案