如何在 Google 表格查询语言中使用不同的 where 子句选择多个不同的计数?

问题描述 投票:0回答:1

我目前正在尝试选择具有不同标准的多个计数。不幸的是,当我尝试将它们合并到同一个查询中时,出现解析错误。它们单独工作得很好,但在一起就不行了。有人知道如何解决这个问题吗?

这工作正常(单独)

Select count(Col2) where Col2 <= 180 

or 

Select count(Col2) where Col2 > 180

or

Select count(Col2)

这不起作用(组合)

Select count(Col2) where Col2 <= 180, count(Col2) where Col2 > 180, count(Col2)

我遇到的错误

Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered
google-sheets google-sheets-formula
1个回答
0
投票

您只能使用一个

where

"select count(Col2) where Col2 <= 180 or Col2 > 180"

如果/需要时,OR 逻辑可以与 AND 逻辑交换

© www.soinside.com 2019 - 2024. All rights reserved.