when_clause ::= matched_clause | not_matched_by_target_clause | not_matched_by_source_clause
matched_clause ::= WHEN MATCHED [ AND search_condition ] THEN { merge_update_clause | merge_delete_clause }
not_matched_by_target_clause ::= WHEN NOT MATCHED [BY TARGET] [ AND search_condition ] THEN merge_insert_clause
not_matched_by_source_clause ::= WHEN NOT MATCHED BY SOURCE [ AND search_condition ] THEN { merge_update_clause | merge_delete_clause }
MERGE INTO target_table AS tt
USING ( SELECT key, field FROM source_table) AS st
ON tt.key = st.key
WHEN NOT MATCHED BY TARGET THEN
INSERT (key, field)
VALUES (st.key, st.field)
WHEN NOT MATCHED BY SOURCE THEN DELETE
;
Grammar or Syntax Description
currently jsqlparser is failing with these kind of statemnt stating UnsupportedStatement
https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#merge_statement
SQL Example
can it be included?
thanks