【问题标题】:Hash_md5() in not working while merging in ExasolHash_md5() 在 Exasol 中合并时不起作用
【发布时间】:2020-10-19 12:20:26
【问题描述】:

我正在尝试基于 Hash_val 合并和更新目标表。 但我得到了错误。 不支持此类合并条件。 下面是代码。

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' 

【问题讨论】:

    标签: sql merge-statement exasol


    【解决方案1】:

    如何将合并的连接条件分解成它的子部分

    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'  
    

    这应该有效地执行与 concat-single 标准上的连接相同的操作。

    【讨论】:

    • 是的,我可以这样做,但我想知道为什么在连接时它不起作用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-31
    • 2014-11-20
    • 2011-03-13
    • 2017-05-07
    • 2017-04-21
    • 2017-08-10
    相关资源
    最近更新 更多