Support Questions

Find answers, ask questions, and share your expertise

HIVE Merge Multiple MATCH Conditions

New Contributor

Hi Team,

Can you please let us know how to implement the below logic with HIVE merge multiple match actions.

MERGE INTO Target_table AS T

USING Source_Table AS S

ON S.col1=T.col1


WHEN MATCHED THEN UPDATE SET T.col2=S.col2


WHEN MATCHED THEN INSERT VALUES ("DUMMY",S.col2,S.col3)


WHEN NOT MATCHED THEN INSERT VALUES ("NEW",S.col2,S.col3) ;

1 REPLY 1

New Contributor

We have to do insert and update on the same table when the condition is MATCHED

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.