码迷,mamicode.com
首页 >  
搜索关键字:不用聚合函数求最高工资    ( 1个结果
不用聚合函数求最高工资
如果不使用聚合函数的话,该从哪个方向出发呢? 可以排序,然后从排序后的结果中取工资最高的;可以取出除最高工资之外的所有工资,然后再排除,剩下最高工资。 select a.sal from (select * from emp order by sal desc) a where rownum = 1; select e.sal from emp e where e.sal not in(select e2.sal from emp e1,emp e2 where e1.sal>e2.sal); select...
分类:其他好文   时间:2015-08-09 20:44:15    阅读次数:180
1条  
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!