I want to create a merge query so that I can insert the new incoming record and update the record if there is any change in record. I created a query as:
MERGE into sales AS TARGET
USING sales1 AS SOURCE
ON (TARGET.Order_ID = SOURCE.Order_ID)
WHEN NOT MATCHED BY TARGET
THEN INSERT VALUES (select * from SOURCE)
But i am getting a error as ERROR: syntax error at or near "MERGE". My Postgres version is PostgreSQL 11.2 My question is in which version does PostgreSQL support merge query. So does PostgreSQL support merge query or not?
What this link[https://wiki.postgresql.org/wiki/MergeTestExamples] refer to? If this link is correct then how to execute merge query in PostgreSQL?