I believe that many programmers have encountered such a problem, which is paging display. When you do, anyway, we should not read all the records to the memory. If you choose to record less, you can, if you have 500,000 records in the table? Make sure you will die the best way: I will ask a question first: I really need to support the application of many databases in many times? No, right? If it is true, then you can implement a set of methods, then use the DAO mode to solve the problem of the problem, pull the database to the database! The method of the Oracle / SQLServer / MySQL three databases first out of the first MY-N-N N record: Get in ascending in ascending order according to the F1 field, records from the M to N row, F1 must be indexed or primary keys, preferably Primary key SQL Server SELECT T2. * From (SELECT TOP NM T1. * From (SELECT TOP N * from Tablename As T1 ORDER BY T1.F1 DESC) AS T2 ORDER BY T2.F1 SELECT T2. * From (SELECT TOP 20 T1. * from DBGEN AS TOP 500020 * from DBGEN As TOP 500020 * from DBGEN AS TOORDER BY T.F1) AS T1 Order By T1.f1 DESC) AS T2 Order by T2.f1 Oracle Select * from (SELECT ROWNUM R, T * from Tablename T where r