개발 수업/DB
[Oracle/SQL] 서브쿼리 수정,삭제
오늘 하루s
2023. 6. 13. 19:21
728x90
더보기
Day31. 230613
서브쿼리
수정
7369사원의 커미션을 30번부서에 근무하면서 81/05에 입사하여 2850급여를 받으며
7839상사 밑에서 MANAGER일을 하는 사원의 커미션과 동일하게 수정
1
2
3
4
5
6
|
update emp
set comm = (select comm
from emp
where deptno=30 and to_char(hiredate,'YY/MM')='81/05'
and sal=2850 and mgr=7839 and job = 'MANAGER')
where empno = 7369;
|
cs |
삭제
1
2
3
4
|
delete emp
where empno in(select empno
from emp
where deptno=40 and sal=6600);
|
cs |
삭제되었는지 확인>
1
2
3
4
|
delete emp
where empno in(select empno
from emp
where deptno=40 and sal=6600);
|
cs |
728x90