为什么我可以在Google查询中使用多个倍数?
我目前正在尝试缩小数据范围。我想消除我不想在查询中提取的某些值。
首先,我想消除 - (dash),
=query(A1:B,"select A where NOT A LIKE '%-%'")
That works,
但是,如果我想继续缩小数据缩小,则使用的数据
=query(A1:B,"select A where NOT A LIKE '%-%' or NOT A LIKE '%WOLF%'")
I am currently trying to narrow down my data. I want to eliminate certain values that I do not want to pull in the query.
First I want to eliminate the - (dash)
=query(A1:B,"select A where NOT A LIKE '%-%'")
That works,
But, if I want to continue to narrow down my data I use
=query(A1:B,"select A where NOT A LIKE '%-%' or NOT A LIKE '%WOLF%'")
That does not work. Instead of narrowing down my data it adds the dash back and keeps wolf . How can I keep using NOT like for multiple strings?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用括号使逻辑更易于遵循,例如:
= query(a1:a,“ where not(a)不(类似'% - %'或类似'%wolf%')),0)
Use parentheses to make the logic easier to follow, like this:
=query(A1:A, "where not (A like '%-%' or A like '%WOLF%')", 0)
最好使用以下等高语:
better to use regex like:
只是为了增加对话,第二个查询将返回任何没有狼和破折号的东西。因此,如果我的数据中有“狼人”和“灰狼”。我会得到“灰狼”,而不是“狼人”。为什么?
或操作员告诉查询如果不是一个或另一个,请返回某些东西。 “灰狼”不像'% - %'。即使它会被“%wolf%”语言过滤,但它是由OR语句的第一部分捕获的,因此查询说:“是的,这就是这样或那样,因为它就像您的无dash语言,我会退还。”和Visa Versa。如果您的数据中有“ mole-person”,那将弹出,因为它不像'%wolf%',并且查询会说:“好吧,我有破折号,但不是狼,所以我会包括它。”
上面的用户建议和操作员,因为这是为了过滤狼和破折号而需要的。它的写作方式,一个单元格必须像查询一样排除它。
我希望这能澄清。
Just to add to this conversation, the second query will return anything that does not have Wolf AND a dash in it. So if I have "Wolf-man" and "Gray Wolf" in my data. I will get "Gray Wolf" back but not "Wolf-Man." Why?
The OR operator tells the query to return something if it's not like one OR the other. "Gray Wolf" is not like '%-%'. Even though it would get filtered by the OR '%Wolf%' language, it's captured by the first part of the OR statement, and so the query says "Yes, this is like this or that, since it is like your no-dash language, I'll return it." And visa versa. If you had "Mole-person" in your data, that would pop up, since it's not like '%Wolf%' and the query will say "well, i's got a dash but it's not a wolf, so I'll include it."
Users above suggested the AND operator, since that is what you'll need in order to filter out BOTH wolves AND dashes. The way it is written, a cell must be like BOTH for the query to exclude it.
I hope this clarifies.