且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Google 电子表格查询错误 - 列不存在

更新时间:2022-05-21 02:56:35

如果您使用 Query 函数直接引用单元格的矩形,那么您使用大写字母来引用列.但是,如果您对数组公式的输出使用 Query,例如从 ImportRange 返回,那么您需要使用 Col1, Col2, ... 引用列.因此,您的示例查询字符串需要读取:

If you are using the Query function with a direct reference to a rectangle of cells, then you use capital letters to refer to the columns. However, if you are using Query against the output of an array formula, such as the return from ImportRange, then you instead need to use Col1, Col2, ... to refer to the columns. So, your example query string would need to read:

"select Col2 where Col5 contains 'Warszawa'"

工作示例:

=Query(ImportRange("0AtEH2Kw9zfIodEQ2dFNFam9sdEFEZlVnNEV3ZEZMZEE", "data!A:G"), "select Col3, count(Col4) group by Col3 order by count(Col4) desc label count(Col4) 'count'")

我不知道为什么它不只允许您使用标题行中的名称.

I've no idea why it doesn't just let you use names from a header row.