drop table student;
create table student(sno number(10), sname varchar2(10),sage int);
insert into student values(1,'aa',21);
insert into student values(1,'aa',21);
insert into student values(2,'bb',22);
insert into student values(3,'cc',23);
insert into student values(3,'cc',23);
insert into student values(3,'cc',23);
select * from student a where a.rowid >(select min(b.rowid) from student b where a.sno=b.sno );
select * from student where rowid not in (select min(b.rowid) from student a,student b where a.sno=b.sno group by b.sno);
2句查出的结果一样,第二句很好理解。我纳闷的就是第一句为什么不是 not in 而是> .
第一句运行了,也就是说(select min(b.rowid) from stundent b where a.sno=b.sno)返回的是单值,这个值跟()外面的 from 表有关。