oracle的子查询中使用some,any和all

Some和any表示满足其中一个的意义,一般来讲some用在“=”的比较从句中.  All则表示满足其其中所有的查询结果的含义.

select ename,sal
From emp
Where sal > any(select sal from emp where deptno = 10);

select ename,sal
From emp
Where sal > some(select sal from emp where deptno = 10);

select ename,sal
From emp
Where sal > all(select sal from emp where deptno = 20);

您可以选择一种方式赞助本站

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

图片 表情