Skip to content

Instantly share code, notes, and snippets.

@springcome
Created October 21, 2013 01:47
Show Gist options
  • Save springcome/7077549 to your computer and use it in GitHub Desktop.
Save springcome/7077549 to your computer and use it in GitHub Desktop.
merge into, oracle
MERGE INTO MEMBER M
USING DUAL
-- 업데이트를 할것인지 인서트를 할것인지의 조건
ON (M.MEMBER_ID = ?)
WHEN MATCHED THEN
-- 조건에 맞으면 업데이트
UPDATE SET MEMBER_UPDATE = ?
WHEN NOT MATCHED THEN
-- 조건에 맞지 않으면 인서트
INSERT (
MEMBER_ID
, MEMBER_UPDATE
) VALUES (
?
, ?
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment