Oracle select * and rownum

问题描述:

习惯了MS Sqlserver的SELECT * 的写法,在Oracle中跟rownum一起写时,

如: SELECT rownum,* FROM   EMP,却提示下面这样的错误:

ORA-00936: 缺失表达式
00936. 00000 -  "missing expression"

解决办法:

Select e.* FROM (Select e.*, rownum as row_id from (Select * FROM emp ORDER BY ename ) e ) e Where row_id >= ((?-1)*?)+1 and row_id <= (?*?);
参考:http://stackoverflow.com/questions/28501988/oracle-select-and-rownum

你可能感兴趣的:(Oracle select * and rownum)