一个小问题。

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 表有关。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值