Hash_md5() 在 Exasol 中合并时不起作用

Posted

技术标签:

【中文标题】Hash_md5() 在 Exasol 中合并时不起作用【英文标题】:Hash_md5() in not working while merging in 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' 

【问题讨论】:

【参考方案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 标准上的连接相同的操作。

【讨论】:

是的,我可以这样做,但我想知道为什么在连接时它不起作用。

以上是关于Hash_md5() 在 Exasol 中合并时不起作用的主要内容,如果未能解决你的问题,请参考以下文章

如何在 DataGrip(Exasol 方言)上的 SQL 查询中使用变量?

Exasol UPSERT 不使用第二张桌子?

存储过程 SQL exasol

数据结构与算法--第5周作业(线性表合并算法)

301 重定向仅在刷新或新窗口上单击时不起作用

在python中生成文件的校验和