【发布时间】:2020-04-14 09:31:57
【问题描述】:
我正在将 SQL 查询转换为 Impala。 SQL 查询在 select 中使用子查询来创建新列,如下 -
select *, (select min(day)
from date_series
where day > t.work_day) as next_work_day
from table1 t
但是,Impala 不支持在 select 中创建新列的子查询,并且此查询失败。能否请我帮助以 Impala 可以执行的方式重写此查询。
查询目的:为work_day 列查找下一个工作日。
Table1 是外部表,包含
table1 contains 4 columns including the work day column
date_series contains all working dates stating from 2019-06-18 to current_day + 5点赞
2019-06-20
2019-06-21
2019-06-24
.
.
【问题讨论】:
-
请提供样本数据、期望的结果以及您想要做什么的解释。