Last active
November 21, 2016 16:13
-
-
Save klashxx/03b2a822e7846c8308d0 to your computer and use it in GitHub Desktop.
MERGE example (oracle)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MERGE INTO tab D | |
USING (SELECT 99999 as id_c1, | |
SYSDATE as c2, | |
'klashxx' as c3, | |
'test' as c4, | |
'test' as c5, | |
'test' as c6, | |
'not_matched' as c7 | |
FROM DUAL) S | |
ON (D.id_c1 = S.id_c1) | |
WHEN MATCHED THEN | |
UPDATE SET D.c7 = 'matched' | |
WHEN NOT MATCHED THEN | |
INSERT VALUES (S.id_c1, S.c2, s.c3, s.c4, s.c5, s.c6, s.c7); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment