日期:2014-05-18 浏览次数:20449 次
;with cte as ( select b,c,count(1) num from test group by b,c having count(1)>1 ) select * from test t where exists( select 1 from cte where b=t.b and c=t.c )
------解决方案--------------------
SELECT A.* FROM test A INNER JOIN ( SELECT b , c FROM test GROUP BY b , c HAVING COUNT(1) > 1 ) T ON A.b = T.b AND A.c = T.c