基于部分匹配列连接两个表

时间:2017-08-09 01:34:16

标签: hive hql

我想基于部分匹配在hive中加入两个表。到目前为止,我尝试使用以下SQL查询:

select * from tableA a join tableB b on a.id like '%'+b.id+'%';
   and instr but nothing working, is there a way?

1 个答案:

答案 0 :(得分:0)

Hive中的

JOIN仅支持等式条件。另外,您应该使用CONCAT进行字符串连接。

这是一个解决方案。

select *
from tableA a, tableB b
where a.id like concat('%',b.id,'%')
相关问题