title: I am having a syntax error in the MERGE statement
body: <p>I have postgres 12.3 and find an error in a simple MERGE statement like below:</p>
  <pre><code>MERGE INTO lkup_language a
     USING (SELECT *
              FROM dblc_stg.stg_lkup_home_language
             WHERE home_lang_code NOT IN (SELECT   home_lang_code
                                             FROM dblc_stg.stg_lkup_home_language
                                         GROUP BY home_lang_code
                                           HAVING COUNT (*) &gt; 1)) b
     ON (a.language_cd = b.home_lang_code)
     WHEN NOT MATCHED THEN
        INSERT (a.language_key, a.language_cd, a.language_desc)
        VALUES (NEXTVAL('SEQ_LKUP_LANGUAGE'),b.home_lang_code, b.home_lang_desc)
     WHEN MATCHED THEN
        UPDATE
           SET a.language_desc = b.home_lang_desc   ;
  </code></pre>
  <p>I hope I get some help
  Thanks
  Ajay</p>