SELECT ROW_NUMBER() OVER (ORDER BY EMPID ASC) AS ROWID, * FROM EMPLOYEE
select * from (select row_number() over(order by Class) as 'myid',* from studb) mytb where mytb.myid>2 and mytb.myid<5
参考:http://blog.sina.com.cn/s/blog_5f92e8c50100kfnp.html