I have 2 tables, main_table has product_id, product_stock and product_name columns.
update_table has product_id, product_stock columns.
I want to update product_stock for main_table.
I wrote this query:
MERGE INTO main_table MT
USING update_table UT
ON MT.product_id = UT.product_id
WHEN MATCHED THEN
UPDATE SET MT.product_stock = UT.product_stock ;
But this query returning with error
ERROR: syntax error at or near "MERGE"
Why my query is not working and how can i make this work ?