如何在配置单元中将列的空白值替换为 [null] 以计算 SUM

问题描述

请指导一下。

我有以下输入表。

enter image description here

我尝试了以下查询

select distinct sum(amount) over partition by date from table1;

这里表中的日期是字符串类型,金额是双精度类型。

解决方法

在进行分组和求和之前,您可以添加 where 以删除具有空白日期的行:

select date,sum(amount)
from table1
where date != ''
group by date