子查询结果充当一个临时表。
//子查询形成的临时表字段为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;
时间: 2024-11-23 14:58:51