Hash_md5() in not working while merging in Exasol

143 views Asked by At

I'm trying to merge and update target table based on Hash_val. but i'm getting below error. Such merge condition is not supported. below is the code.

merge into table1 as t1 
using table2 as t2
on hash_md5(t1.col1||t1.col2||t1.col3)=hash_md5(t2.col1||t2.col2||t2.col3)
when matched then
update t1.col4='XYZ' 
1

There are 1 answers

1
laol On BEST ANSWER

What about breaking up the join condition of the merge into it's subparts

merge into table1 as t1 
using table2 as t2
on t1.col1=t2.col1
and t1.col2=t2.col2
and t1.col3=t2.col3

when matched then update set t1.col4='XYZ'  

This should effectively do the same as a join on a concat-single criterion.