SQL ANY 查询 - 有效语法
尝试使用以下“ANY”语法并收到错误:
SELECT DISTINCT Em.ename
FROM Emp Em, Dept D
WHERE Em.eid In (Select D.managerid
FROM Dept D
GROUP BY D.managerid
HAVING EVERY (D.budget > 1000000) AND ANY (D.budget < 5000000)
);
错误输出:
psql:queries.sql:28: ERROR: syntax error at or near "ANY"
LINE 6: HAVING EVERY (D.budget > 1000000) AND ANY (D.budget < 5...
^
编辑:我正在使用 Postgres 并使用 Psql 进行连接。
Trying to use the following 'ANY' syntax and gets an error:
SELECT DISTINCT Em.ename
FROM Emp Em, Dept D
WHERE Em.eid In (Select D.managerid
FROM Dept D
GROUP BY D.managerid
HAVING EVERY (D.budget > 1000000) AND ANY (D.budget < 5000000)
);
Error output:
psql:queries.sql:28: ERROR: syntax error at or near "ANY"
LINE 6: HAVING EVERY (D.budget > 1000000) AND ANY (D.budget < 5...
^
Edit: I am using Postgres and connecting using Psql.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以让它变得更简单,不是吗?
或
或
You can make it simpler, no?
or
or