时间:2021-07-01 10:21:17 帮助过:9人阅读
select * from tt t where exists (select 1 from tt where dan=t.dan and id !=t.id);
应该是关于数据库的问题:oracle:select * from t where dan in (select dan from t where having count(dan)>1 group by dan)。
恩,SELECT * from ssc_record WHERE types = 7 and dan1 in(SELECT dan1 from ssc_record GROUP BY dan1 HAVING count(1)>2)
这样查询起来好慢阿 数据量大就卡在那不会动了。
select id,dan,money,count(*) as num from ssc_record group by dan having num > 1