add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table product(product_id int, product_name varchar(20), rate int);
insert into product values(1, 'Tea', 22), (2, 'Coffee', 30), (3, 'Muffin', 67);

create table updated_products (product_id int, product_name varchar(100), rate int);
insert into updated_products values (1, 'tea', 10), (2, 'coffee', 20), (3, 'muffin', 30);

merge into product t
using updated_products s on t.product_id = s.product_id
when matched then
update set
t.product_name = s.product_name,
t.rate = s.rate
when not matched then
insert (product_id, product_name, rate) values (s.product_id, s.product_name, s.rate);

9 rows affected