The first 10 or 10th to 20th records ROWNUM obtained in Oracle are commonly used for paging output. for example, the SELECT name FROM member where rownum <= 10 statement is used to output the first 10 records, similar to the SQL sever top (select top 10 * from tablename ), however, rownum should be more powerful for the output of the specified number range: SELECT name FROM (SELECT name, ROWNUM rn FROM member) WHERE rn> = 10 AND rn <= 20 this statement outputs 10th to 20th records. Why should we use nested queries? Because rownum itself can only be compared using the <= method, only when it is converted to an instance can it be compared with> =. In actual use, www.2cto.com usually requires the latest records. Therefore, you need to sort the records before getting rownum <= Common SELECT * FROM (SELECT m. * FROM member m order by create_time DESC) where rownum <= 10, some may say SELECT m. * FROM member m where rownum <= 10 order by create_time DESC; the main difference between the two statements is: whether to sort first, query first, or then sort. Obviously, the first sentence is sorting first and then querying, and the second sentence is sorting first. The purpose of the two is to get the results of the desired class.