select * from 表 A, (select aa,bb from 表 group by aa,bb) B where A.aa=B.aa and A.bb=B.bb

解决方案 »

  1.   

    select A.* from 表 A, (select aa,bb from 表 group by aa,bb) B where A.aa=B.aa and A.bb=B.bb
      

  2.   

    select * from 表 a
      where exists(select count(*) from 表 where aa=a.aa and bb=a.bb and cc=a.cc
                   group by aa,bb having count(*)>1)
      

  3.   

    SELECT A.*
    FROM yourTable A
    INNER JOIN (
    SELECT aa, bb
    FROM yourTable
    GROUP BY aa, bb
    HAVING COUNT(*) > 1
    ) B ON B.aa = A.aa
    AND B.bb = A.bb
    ORDER BY A.aa, A.bb
      

  4.   

    楼上的理解错了,应该是找出aa、bb重复的纪录吧
      

  5.   

    select a.* from table a, (select aa,bb from table group by aa,bb) b where a.aa=b.aa and a.bb=b.bb不知道可以吗?
      

  6.   

    有没有试过:
    select * from 表 a
      where exists(select count(*) from 表 where aa=a.aa and bb=a.bb and cc=a.cc
                   group by aa,bb having count(*)>1)
      

  7.   

    用这个绝对可以
    select * from table_name a ,(select aa,bb from table_name group by aa,bb having count(*) > 1) b where a.aa = b.aa and a.bb=b.bb
      

  8.   

    前面应该是a.*
    select a.* from table_name a ,(select aa,bb from table_name group by aa,bb having count(*) > 1) b where a.aa = b.aa and a.bb=b.bb