FROM使用子查询
FROM使用子查询
子查询结果充当一个临时表。
//子查询形成的临时表字段为NO,NAME,SAL
select no,name from(
select empno no,ename name,sal from emp
);
//子查询形成的临时表字段为DEPTNO,AVG
select deptno,avg
from(
select deptno,avg(sal) avg
from emp
group by deptno
)
where avg>2000;
随笔有些是自己写的,有些是根据网上的东西自己整理的,文章基本都是别人的,只是为方便查看复制到那里