select id,count(*) from tablename group by id having count(*) > 1
SQL> select b.id,b.doctime from (select id,count(*) sumnum from test1 group by i d) a,test1 b where a.id=b.id and a.sumnum>1; ID DOCTIME ---------- --------- 1 01-JUL-02 1 01-MAY-02 1 20-AUG-02 1 01-JUL-02 1 01-SEP-02Elapsed: 00:00:00.40
select columnname from tablename group by columnname having count(*) > 1
d) a,test1 b where a.id=b.id and a.sumnum>1; ID DOCTIME
---------- ---------
1 01-JUL-02
1 01-MAY-02
1 20-AUG-02
1 01-JUL-02
1 01-SEP-02Elapsed: 00:00:00.40
from tablename
group by columnname
having count(*) > 1
luckysxn 和zhengg21说的对
提问的人是不是只认字数啊?