首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

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

2012-07-24 
关于子查询中不能使用order by 的理解select * from (select * from emp e where e.sal 1000 order by e

关于子查询中不能使用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

热点排行