Oracle分页查询

SELECT * FROM   
(  
SELECT A.*, ROWNUM RN   
FROM (SELECT * FROM Nmk_operator_net) A   
WHERE ROWNUM <= 20  
)  
WHERE RN >= 10 

查询第10行到第20行的内容

原理:
1 Oracle executes your query.
2 Oracle fetches the first row and calls it row number 1.
3 Have we gotten past row number meets the criteria? If no, then Oracle discards the row, If yes, then Oracle return the row.
4 Oracle fetches the next row and advances the row number (to 2, and then to 3, and then to 4, and so forth).
5 Go to step 3.

你可能感兴趣的:(Oracle分页查询)