SQL中的所有操作员
我有一项任务可以选择所有工人的职位,其中所有工人的工资在400-700美元之间。但是我的查询不起作用,我不知道为什么。
SELECT DISTINCT position
FROM
job
WHERE position = ALL
(SELECT
position
FROM
job
WHERE
salary BETWEEN 400 and 700);
I have a task to select positions all workers of which get salary between 400-700$. But my query does not work I do not know why.
SELECT DISTINCT position
FROM
job
WHERE position = ALL
(SELECT
position
FROM
job
WHERE
salary BETWEEN 400 and 700);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
扭转条件:
您可能还想阅读所有操作员的工作方式。您的查询错误地假设所有职位都是相同的(否则所有职位都无法正常工作)。
或者,使用全部两次:
Reverse the condition:
You also might want to read about how ALL operator works like. Your query incorrectly assumes all positions are the same (otherwise ALL will not work).
Alternatively, use ALL twice: