读书人

关于子查询中不能应用order by 的理解

发布时间: 2012-07-24 17:47:58 作者: rapoo

关于子查询中不能使用order by 的理解

select * from (select * from emp e where e.sal < 1000 order by e.empno) t order by t.sal desc;

这条SQL的子查询里面 包含了子查询 就可以执行
而下面这条SQL
select rownum , t.col1, t.col2, ... from( select col1, col2, ... from tab order by col1 ) twhere rownum <= n;
参考文章:http://blog.csdn.net/lee576/article/details/2685647

读书人网 >其他数据库

热点推荐