将单列值转换为配置单元中的多列

时间:2019-03-06 13:11:29

标签: hive

我有一个每周更新的表格,我需要检查一周和上周之间的计数变化检查。我只是在下面做...。

Select
case when F.wk_end_d=max(F.wk_end_d) over (partition by F.wk_end_d)then F.the_count end as count
from
(
    select wk_end_d, count(*) as the_count
    from table A
    where wk_end_d between date_sub('2019-03-02',7) and '2019-03-02'
    group by wk_end_d
) F

赋予我以下类似的价值

100
200

但是我需要在2个不同的列上获得类似100 200的值,因为我需要在其上面进行一些其他计算。

0 个答案:

没有答案
相关问题