select * from tt t where exists (select 1 from tt where dan=t.dan and id !=t.id);

解决方案 »

  1.   

    应该是关于数据库的问题:oracle:select * from t where dan in  (select dan from t where having count(dan)>1 group by dan)。
      

  2.   

    恩,SELECT * from ssc_record WHERE types = 7 and dan1 in(SELECT dan1 from ssc_record GROUP BY dan1 HAVING count(1)>2) 
    这样查询起来好慢阿 数据量大就卡在那不会动了。
      

  3.   

    select id,dan,money,count(*) as num from ssc_record  group by dan having num > 1