a b c
1 2 3
1 2 2
1 3 3
2 3 4
2 3 5
我想找到所有相同的 a+b
对于该数据,我的结果应该是
1 2 3 (look a and b)
1 2 2 (look a and b) they are same so should be in the result
**
2 3 4 (look a and b)
2 3 5 (look a and b) they are same so should be in the result
*
select count(a),a,count(b),b from Table A
group by a,b
having count(a)>1
and count(b)>1
就像那样工作,我可以看到哪些是那样的。但我想查看原始数据。
我怎样才能看到所有带有这个有子句的数据?因为该表有很多列,我不想按它们分组。我只想按 a 和 b 分组并查看所有列。