首页 > 解决方案 > 查询 google sheet =>“null”在这个公式中是如何工作的?

问题描述

如果列 J (Col10) 为空,我有 1 个主表,我想在其中添加其他 2 个表中的所有数据。

这个公式不起作用:

=query({'BXL | hair salon | Export'!1:1000; 'BXL | Bike shop | export'!1:1000}, "select * where Col10 is null", 1)

在这种情况下,我只从第一张表中得到结果。(BXL | 美发沙龙)

相反,我执行以下操作(并添加列 j 不为空的所有数据)确实有效(但这不是我需要的):

=query({'BXL | hair salon | Export'!1:1000; 'BXL | Bike shop | export'!1:1000}, "select * where Col10 is not null ", 1)

这怎么可能?有什么关于 null 我不明白的吗?

标签: google-sheetsnullgoogle-query-language

解决方案


好的,我找到了答案。

Not null 也采用完全空行的单元格。当我向下滚动(方式)时,我可以看到结果。

我现在像这样修复它:

=query({'BXL | hair salon | Export'!1:1000; 'BXL | Bike shop | export'!1:1000}, "select * where (Col10 is NULL and Col2 is not null )", 1)

由于每列 B 在非空行时都有数据,因此这会过滤掉完全空的行。


推荐阅读