sqlite子查询语法错误
我在这个子查询中有一个语法错误,我似乎无法弄清楚为什么它不起作用。所有括号都匹配
select min(max_s)
from
(select max(salary) from instructor group by dept_name)
as s(max_s);
Error: near "(": syntax error
I have a syntax error in this subquery that I cannot seem to figure out why it won't work. All the parens are matched
select min(max_s)
from
(select max(salary) from instructor group by dept_name)
as s(max_s);
Error: near "(": syntax error
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用:
Use:
问题出在
AS s(max_s)
表别名中,它看起来不太正确。您应该为子查询中的列名称添加别名,例如:The problem is in the
AS s(max_s)
table alias, which doesn't look quite right. You should alias the column name inside the subquery, for example:不要在表别名后面加上括号。
Don't put parens after a table alias.