如何在配置单元中将列的空白值替换为 [null] 以计算 SUM
How to replace blank value of a column to [null] in hive to calculate SUM
能否请您指导一下。
我有以下输入 table。
我尝试了以下查询。
select distinct sum(amount) over partition by date from table1;
这里的table日期是string类型,amount是double类型。
您可以添加 where
以删除日期为空的行,然后再进行分组和求和:
select date, sum(amount)
from table1
where date != ''
group by date
能否请您指导一下。
我有以下输入 table。
我尝试了以下查询。
select distinct sum(amount) over partition by date from table1;
这里的table日期是string类型,amount是double类型。
您可以添加 where
以删除日期为空的行,然后再进行分组和求和:
select date, sum(amount)
from table1
where date != ''
group by date