我无法在 oracle 9i 中使用 minus 关键字!
select salary from employees order by salary desc
MINUS
select salary from employees where rownum<10 order by salary desc;
我无法将 order by 与 MINUS 一起使用,它表示 sql 命令未正确结束。 请建议!
select salary from employees order by salary desc
MINUS
select salary from employees where rownum<10 order by salary desc;
I am unable to use order by with MINUS ,it says sql command not properly ended.
Please suggest!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
考虑到业务问题似乎是什么(显示工资不在工资前十名的员工的工资),我认为分析将是一个值得考虑的选择:
使用分析也只会扫描
EMPLOYEES
一次,而原始查询会扫描两次。Given what the business question seems to be (show the salaries of employees where the salary is not in the top ten of salaries) I would think analytics would be a choice worth considering:
Using analytics would also only scan
EMPLOYEES
once, whereas the original query would scan it twice.