[英]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.