我有两个表,main_table有product_id、product_stock和product_name列.
update_table有product_id,product_stock列.
我想把product_stock换成main_table.
我写了这样一个查询:
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 ;
但此查询返回错误
ERROR: syntax error at or near "MERGE"
为什么我的查询不起作用?我如何才能使其起作用?