Id Name
1 a1
2 b2
2 b3
3 c4
3 c5
3 c6
4 d7
查询结果得出:
Id Name
2 b2
2 b3
3 c4
3 c5
3 c6
------解决方案--------------------
- SQL code
select a.*from yourTable a , (select id from yourTable group by id having count(*)>1) bwhere a.id=b.id
select a.*from yourTable a , (select id from yourTable group by id having count(*)>1) bwhere a.id=b.id