hive报错:Both left and right aliases encountered in JOIN


Cause: The two tables join when the field is not supported two tables of non-equal operation.

Solution:
1, the unequal conditions to get the where clause

select ... from
class_order t1
left join class_order_refund t2 on t1.orderdate>t2.orderdate

It can be rewritten as

select ... from
class_order t1
left join class_order_refund t2
where t1.orderdate>t2.orderdate

2, if the first method is not applicable, based on the select field

select
...
if(t1.orderdate>t2.orderdate,0,1) as is_refund
...
from
class_order t1
left join class_order_refund t2 on t1.orderdate>t2.orderdate

13280750-206341f01732ec77.jpg
Subscribe to "K-tert-block chain" - focused on the block chain technology learning

Blog address: http://www.jouypub.com
Jane book Home: https://www.jianshu.com/u/756c9c8ae984
segmentfault Home: https://segmentfault.com/blog/jouypub
Tencent cloud Home: HTTPS: / /cloud.tencent.com/developer/column/72548

Guess you like

Origin blog.csdn.net/weixin_33904756/article/details/90791410