【发布时间】:2017-03-23 15:44:26
【问题描述】:
错误:编译语句时出错:FAILED:遇到 0 个子级的 SemanticException (state=42000,code=40000)
我是否需要找到解决方案来使子查询脱离 on 条件?
select
-- a bunch of stuff min,max,sum and case statements
from tbl0 t0
inner join tbl4 t4 on (t4.aKey = t0.aKey)
left outer join tbl1 t1 on (t0.col0 = t1.col0 and t1.someKey in (select t3.aKey from tbl3 t3 where t3.someCode in ('A1','A2','A3')))
where
not(t4.aCode in ('string1' , 'strin2' , 'string3' , 'string4') and t1.someKey is null) and not (t4.bCode in ('string1' , 'string2') and t1.someCol = 0)
【问题讨论】:
-
t4? ……
-
@DuduMarkovitz 有 26 个连接,我只放入导致问题的连接,因为它可能会有点疯狂......查询是 192 行的崇高......是的,它可以服务一个独特的目的,每晚运行一次。它是 ETL 替换的集合......还有为什么名称很时髦不想使用供应商逻辑/命名
-
这不是风格评论。如您所见,
t4未在您的查询中定义。 -
@DuduMarkovitz 是的,很抱歉我把它扔进去以避免混淆。
-
收集其他表中所有子查询的数据并放入join。如果它适用于您的用例。