MySQL의 Duplicate와 같은 기능을 하는 방법으로 Oracle에서 주로 사용된다.
Insert into {테이블} values({데이터})
On Duplicate Key update {update할 데이터처리}
Merge into {기준 테이블}
Using {참조테이블|dual}
on {조건}
when matched then
Update set
when unmatched then
Insert {컬럼} values{데이터값}
해당 기준 테이블의 update, insert하게 된다.
'DB > Oracle' 카테고리의 다른 글
[Oracle] DBLink @ (1) | 2023.10.11 |
---|---|
[Oracle] Decode(if, else if, else) (0) | 2023.09.20 |
[Oracle] Trigger (0) | 2023.09.12 |