我们拒绝平庸,拒绝随波逐流,拒绝墨守成规,让梦想不再流浪。
oracle语法 续2
上一篇 /
下一篇 2014-05-27 17:30:48
/ 个人分类:甲骨文
%N4Ys&}u E5~0 DDL 中使用子查询51Testing软件测试网U'B|PQ.e*DN
H*Oz
========================================================51Testing软件测试网r8~k
e4?$]w
create table 语句中的子查询51Testing软件测试网%[8B:E-me*E8un*s ut
--------------------------
UH6bPScIj9QT'L0create table dept1 (deptno, dname, loc) as51Testing软件测试网v7^5yW1m&X_ q
select deptno, dname, loc from dept;51Testing软件测试网9}(U/CjTaI
pU3t+kU(z0create table emp1 as
+i)f2V.J,g"Rf Z
M0select * from emp;51Testing软件测试网
XX ME&_
\R2U[k#w
========================================================51Testing软件测试网^D&M(sg0y3xgF
create view 中使用子查询
Qp9j5d([1Qlb%f
O0-----------------------51Testing软件测试网7`"UM\6w\ o%g8e1c6_
create or replace view dept_20 as51Testing软件测试网^)B;d%Y!b4Kr$wr4G
select * from emp1 where deptno = 20 order by empno;51Testing软件测试网q0N`6uP
H8n|(Y
C8~K/P|!Rj9zS!m0
S f eW(|
C*z0========================================================51Testing软件测试网(X7E$]0_ WQ)C
DML 中使用子查询
?h#I.[4T/AS0========================================================
R%G"eR!R"g|K.t0update 语句中使用子查询
/K2e6QG.f0-----------------------51Testing软件测试网zyG-r$P)GpiE
update emp1 set (sal,comm) =
^5BF1pmrV&bR4|0( select sal, comm from emp1 where ename = 'WARD' )
"iK
E1hMwe{Au0where job = ( select job from emp1 where ename= 'WARD' )
^ c0L6ae z.[!b0
btq$U#e.N4{{ n)w1b0========================================================
N)k;pd
m`JOx
]0delete 语句中使用子查询51Testing软件测试网A8aEO,@
-----------------------51Testing软件测试网Y'T+m!A9h"CF ?
delete from emp151Testing软件测试网_Ykn7s,G$Q MU
where deptno = (select deptno from dept1 where dname = 'ACCOUNTING' )51Testing软件测试网:\G R`7nJ$U&v