Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google sheets 什么';google sheets中查询字符串的正确语法是什么?_Google Sheets_Google Sheets Formula_Google Sheets Query_Google Query Language - Fatal编程技术网

Google sheets 什么';google sheets中查询字符串的正确语法是什么?

Google sheets 什么';google sheets中查询字符串的正确语法是什么?,google-sheets,google-sheets-formula,google-sheets-query,google-query-language,Google Sheets,Google Sheets Formula,Google Sheets Query,Google Query Language,当我使用数字这样的查询函数时,它会返回正确的结果: =QUERY(Sheet2!A1:B12,"select B where A matches '1200'", 0) 但是,当我尝试匹配字符串时,结果总是空输出: =QUERY(Sheet2!A1:B12,"select B where A matches 'qwerty'", 0) 这似乎非常简单,但我似乎在任何地方都找不到答案。。匹配字符串的正确语法是什么?我在这里提供了一个问题示例:这确实很简单,您需要使用“=”符号来代替匹配。因此,

当我使用数字这样的查询函数时,它会返回正确的结果:

=QUERY(Sheet2!A1:B12,"select B where A matches '1200'", 0)
但是,当我尝试匹配字符串时,结果总是空输出:

=QUERY(Sheet2!A1:B12,"select B where A matches 'qwerty'", 0)

这似乎非常简单,但我似乎在任何地方都找不到答案。。匹配字符串的正确语法是什么?我在这里提供了一个问题示例:

这确实很简单,您需要使用“=”符号来代替匹配。因此,您的公式将是
=QUERY(Sheet2!A1:B12,“选择B,其中A='qwerty',0)

我建议您将Sheet2的ColumnA格式化为纯文本。

对于数字:

=QUERY(Sheet2!A1:B12, "select B where A = 1200", 0)
=QUERY(Sheet2!A1:B12, "select B where A = 'qwerty'", 0)
就案文而言,它将是:

=QUERY(Sheet2!A1:B12, "select B where A = 1200", 0)
=QUERY(Sheet2!A1:B12, "select B where A = 'qwerty'", 0)
对于带有外部参考的编号:

=QUERY(Sheet2!A1:B12, "select B where A ="&1200, 0)
=QUERY(Sheet2!A1:B12, "select B where A = '"&"qwerty"&"'", 0)
对于具有外部引用的文本:

=QUERY(Sheet2!A1:B12, "select B where A ="&1200, 0)
=QUERY(Sheet2!A1:B12, "select B where A = '"&"qwerty"&"'", 0)
对于混合数据,您可以将其格式化为纯文本或:

=ARRAYFORMULA(QUERY(TO_TEXT(Sheet2!A1:B12), "select Col2 where Col1 = 'qwerty'", 0))

你检查过我的例子了吗?你的建议行不通。