创建视图创建问题
CREATE VIEW UrgentQuantity AS
select sum(L_QUANTITY)
FROM LINEITEM
INNER JOIN ORDERS
ON O_ORDERKEY = L_ORDERKEY
WHERE O_ORDERPRIORITY = '1-URGENT'
上面的代码完全可以运行,无需使用以下行:
CREATE VIEW UrgentQuantity AS
然而,我目前感到困惑的是错误消息显示:
[15:23:55] 在数据库“tpch”上执行 SQL 查询时出错:“WHERE”附近:语法错误
暗示问题在于“where”语句,即使该语句之前已运行。
CREATE VIEW UrgentQuantity AS
select sum(L_QUANTITY)
FROM LINEITEM
INNER JOIN ORDERS
ON O_ORDERKEY = L_ORDERKEY
WHERE O_ORDERPRIORITY = '1-URGENT'
The above code completely functions without the line:
CREATE VIEW UrgentQuantity AS
What I am confounded with currently is however that the error message says:
[15:23:55] Error while executing SQL query on database 'tpch': near " WHERE": syntax error
Implying that the issue lies with the 'where' statement, even though that was functioning earlier.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论