假设你只要找到一个重复值最少的enno,下面的SQL会排除那些有同样重复值的enno.select * from ( select count(*) as num,enno from enfile gourp by enno order by count(*) ) where rownum < 2;
空杯兄,应该是这样的,因为搜索出来最少的不一定只有一条记录 select a.* from ( select enno ,count(enno ) as num from enfile group by enno order by count(enno) )a, ( select num from ( select enno ,count(enno ) as num from enfile group by enno order by count(enno) ) where rownum = 1 )d where a.num = d.num
from
(
select enno ,count(enno ) as num
from enfile
group by enno order by count(enno)
)a,
(
select num
from
(
select enno ,count(enno ) as num
from enfile
group by enno order by count(enno)
)
where rownum = 1
)d
where a.num = d.num