1

Google 电子表格的 Query 函数返回空数据和 order by。这是正常工作的查询:

=QUERY('OtherListName'!A1:C;"Select A, B, C";1)

此查询完全返回您所期望的:范围 A1:C 的内容(在我的情况下有 6 行)。然后我尝试订购返回的数据:

=QUERY('OtherListName'!A1:C;"Select A, B, C order by A, B";1)

此查询仅返回第一行(包含标题),仅此而已。OtherListName 中的原始数据集仅包含字符串和整数。

我想要的是按 A 列和 B 列排序数据。两列都只包含字符串。对应的整数在 C 列中。

请分享一些建议,我还没有找到任何东西。同时我会继续我的实验来找出这个“错误”的原因。谢谢。

4

1 回答 1

11

尝试过滤掉空行...

=QUERY('OtherListName'!A1:C; "Select A, B, C where A <>'' order by A, B";1) 

或者,如果 A 中的数据是数字

=QUERY('OtherListName'!A1:C; "Select A, B, C where A is not null order by A, B";1)
于 2017-03-08T12:55:53.350 回答