2022-01-18
閱讀量:
472
子查詢
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)


暫無數(shù)據(jù)
推薦帖子
0條評論
1條評論
0條評論