I need to execute the following MySQL-query in Oracle:
INSERT INTO users VALUES(1,10) ON DUPLICATE KEY UPDATE points = 10;
Is there something else besides merge
? I just don't understand it.
If you don't want to use MERGE, you can try:
begin
INSERT INTO users VALUES(1,10);
exception
when dup_val_on_index then
update users
set points = 10
where id = 1;
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With