Skip to content

Instantly share code, notes, and snippets.

@scanbix
Created November 8, 2023 14:11
Show Gist options
  • Save scanbix/29b366c902bd4731e37f560f4d21bf39 to your computer and use it in GitHub Desktop.
Save scanbix/29b366c902bd4731e37f560f4d21bf39 to your computer and use it in GitHub Desktop.
oracle db DML
#https://oracle-base.com/articles/9i/merge-statement
MERGE INTO employees e
USING hr_records h
ON (e.id = h.emp_id)
WHEN MATCHED THEN
UPDATE SET e.address = h.address
WHEN NOT MATCHED THEN
INSERT (id, address)
VALUES (h.emp_id, h.address);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment