Oracle篇 之 子查询
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle篇 之 子查询相关的知识,希望对你有一定的参考价值。
子查询:先执行内部再外部
Select last_name,salary,dept_id
From s_emp
Where dept_id in (
Select dept_id
From s_emp
Where dept_id is not null
);
Select last_name,dept_id
From s_emp
Where dept_id = (
Select dept_id
From s_emp
Where last_name=’Smith’
);
Select salary,last_name
From s_emp
Where salary<(
Select avg(salary)
From s_emp
);
Select last_name,dept_id,title
From s_emp
Where dept_id =(
Select dept_id
From s_emp
Where last_name=’Smith’
) and tltle = (select tltle
From s_emp
Where last_name=’Smith’
);
Select rownum,last_name,salary
From s_emp
Where rownum<=20
minus
Select rownum,last_name,salary
From s_emp
Where rownum<=10
;
以上是关于Oracle篇 之 子查询的主要内容,如果未能解决你的问题,请参考以下文章