为什么我在 google 工作表中出现文字数组错误?

Why do i get an literal array Error in google sheets?

我对 Google 表格中的以下 QUERY 代码有疑问。 所有行都可以正常接受第一行。 BY 列使代码崩溃。当我将列更改为 BZ 时,它工作正常,但这不是我需要的数据。我做错了什么?

我得到的错误:

错误 在 ARRAY_LITERAL 中,数组文字缺少一行或多行的值。

QUERY({
        QUERY('Form Responses 1'!$A:$CS51, "select A, BR, E, F, BT, BY, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, BJ, E, F, BL, BQ, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, BB, E, F, BD, BI, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, AT, E, F, AV, BA, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, AL, E, F, AN, AS, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, AD, E, F, AF, AK, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, V, E, F, X, AC, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, N, E, F, P, U, I, H")
},"select Col1, Col2, Col3, Col4, Col5, Col6, Col7,Col8 WHERE Col2 is not null ORDER BY Col1")

BY是查询语言的关键字。您必须转义它才能将其用作查询的参数。使用反引号 (`) 转义查询公式中的列名:

=QUERY({
        QUERY('Form Responses 1'!$A:$CS51, "select A, BR, E, F, BT, `BY`, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, BJ, E, F, BL, BQ, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, BB, E, F, BD, BI, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, AT, E, F, AV, BA, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, AL, E, F, AN, AS, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, AD, E, F, AF, AK, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, V, E, F, X, AC, I, H");
        QUERY('Form Responses 1'!$A:$CS51, "select A, N, E, F, P, U, I, H")
},"select Col1, Col2, Col3, Col4, Col5, Col6, Col7,Col8 WHERE Col2 is not null ORDER BY Col1")