2022-01-18
阅读量:
434
子查询
8、标量子查询:select * from emp
where sal>(select avg(sal) from emp);
9、行子查询:select empno, ename,job,deptno
from emp
where (deptno,job)=(select deptno,
job from emp where ename='smith' )
and ename<>'smith';
10、子查询操作符:
not in() 在/不在其中
any 满足其中任意一个
all 都满足
11、列子查询:select * from
emp left join saligrade
on sal between lasal and hisal
where yuangongid not in (select
lingdao id from where is not null) ;
12、any操作符(任意一个): select * from emp where sal >any(select sal from emp where deptno=30) and deptno<>30;
13、all操作符: select * from emp where sal >
all(select sal from emp where deptno=30);






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论