简体   繁体   English

错误代码 BIG QUERY:预期输入结束但得到关键字 SELECT bigquery

[英]Error code BIG QUERY: Expected end of input but got keyword SELECT bigquery

Not sure why I'm getting this error code:不确定为什么会收到此错误代码:

Expected end of input but got keyword SELECT bigquery预期输入结束但得到关键字 SELECT bigquery

Screenshot of the query editor 查询编辑器的屏幕截图

I'm able to run the query but yet the error appears on the side which doesn't allow me to save view.我能够运行查询,但错误出现在不允许我保存视图的一侧。

Any help would be appreciated, thanks!任何帮助将不胜感激,谢谢!

The query editor tries to interpret the entire contents of the editor window as valid SQL. You don't have a terminator on the first SELECT statement, so the parser keeps going and throws an error when it sees the second SELECT keyword because, taken all together, the contents of the editor don't represent a single valid SQL statement.查询编辑器尝试将编辑器 window 的全部内容解释为有效的 SQL。第一个SELECT语句没有终止符,因此解析器继续运行并在看到第二个SELECT关键字时抛出错误,因为,采取了所有总之,编辑器的内容并不代表单个有效的 SQL 语句。 If you select the statement and run it, the parser only looks at the text you've selected.如果您输入 select 语句并运行它,解析器只会查看您选择的文本。 I suspect that's why you can run the first statement but the editor still shows that error.我怀疑这就是为什么您可以运行第一条语句但编辑器仍然显示该错误的原因。

Try putting a semicolon at the end of the first statement, as in: SELECT * FROM covid-deaths-323215.covid_deaths.covid_deaths;尝试在第一个语句的末尾放置一个分号,例如: SELECT * FROM covid-deaths-323215.covid_deaths.covid_deaths; . . Note you probably also need a space between SELECT and * .请注意,您可能还需要在SELECT*之间留一个空格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 语法错误:预期输入结束但在 BigQuery 中获得了标识符 - Syntax error: Expected end of input but got identifier in BigQuery 语法错误:应为“(”或“,”或关键字 SELECT 但脚本结束 - Syntax error: Expected "(" or "," or keyword SELECT but got end of script DBT - 语法错误:应为“(”或关键字 SELECT 或关键字 WITH 但关键字 CREATE 位于 - DBT - Syntax error: Expected "(" or keyword SELECT or keyword WITH but got keyword CREATE at 语法错误:预期的输入结束但在 - Syntax error: Expected end of input but got "(" at 语法错误:应为“)”但在 [2:93] 处获得了关键字 NEW - Syntax error: Expected ")" but got keyword NEW at [2:93] Google BigQuery SQL 错误 - 语法错误:预期为“)”但在 [4:12] 得到了“(” - Google BigQuery SQL Error - Syntax error: Expected ")" but got "(" at [4:12] 使用 with 子句时出错我收到消息“语法错误:预期的关键字 AS 但在 [7:14] 得到了“(” - Error using the with clause I received message " Syntax error: Expected keyword AS but got "(" at [7:14]" 大查询“SELECT * EXCEPT” - Big query "SELECT * EXCEPT" 错误:sink() 得到了一个意外的关键字参数 'parent' - Error: sink() got an unexpected keyword argument ‘parent’ Athena 查询错误:外部输入'select' expecting - Athena query error : extraneous input 'select' expecting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM