2012. 7. 21. 09:11
[Oracle] JOIN DELETE
2012. 7. 21. 09:11 in Database / Sql
## 1 ##
DELETE
FROM 테이블1 A
WHERE EXISTS
(
SELECT 1
FROM 테이블2 B
WHERE A.테이블1_키 = B.테이블2_키
);
DELETE
FROM T_CLASS_DIAG A
WHERE EXISTS
(
SELECT 1
FROM T_PORTFOLIO_HISTORY
WHERE LECTURE_ID = A.LECTURE_ID
AND USER_ID = A.USER_ID
);
## 2 ##
DELETE
FROM SG2EXAMT T1
WHERE (T1.PATNO,T1.ORDDATE,T1.RESVTYPE)
= (SELECT PATNO,ORDDATE,RESVTYPE
FROM SG1RESVT T2
WHERE T2.CUSTCODE = '125000'
AND T2.ACPTDATE = TO_DATE('20100329','YYYYMMDD')
);
'Database / Sql' 카테고리의 다른 글
[Oracle] PL/SQL - 블럭 구조 (0) | 2012.10.31 |
---|---|
[Oracle] PL/SQL - 개념과 예제 (0) | 2012.10.31 |
[Oracle] Windows 2008 R2 64bit 에서 Oracle ODBC 설정 (0) | 2012.07.11 |
[Oracle] Windows 64bit 오라클 Client 설치 (0) | 2012.07.11 |
[Oracle] Toad vs Oracle Product Release History (0) | 2012.06.19 |