Page query SQL statement for the Oracle database tutorial
Oracle
SELECT *
From (select RowNum r,t1.* from table name T1 where rownum < m + N) T2
where T2.R >= m
For example, from the table sys_option (primary key is sys_id) from 10 records or retrieve 20 records, the statement is as follows:
SELECT *
From (select RowNum r,t1.* from sys_option where RowNum <) T2
where T2.R >= 10
MySQL Tutorial
SELECT * FROM table name limit M,n
From 10 records or 20 records from table Sys_option (primary key to sys_id)
SELECT * FROM Sys_option limit 10,20
Sql server
Take the n record from the first m record in the database table, using the keyword top: it is noteworthy that if the SELECT statement has both top and order BY, it will be selected from the sorted result:
SELECT *
From (select Top N * FROM
(select Top (m+n-1) * FROM table_name ORDER BY PRIMARY key desc) tbl_1) tbl_2
ORDER BY PRIMARY key ASC
Example here: (from the table sys_option (primary key sys_id) from 10 records or retrieve 20 records)
SELECT *
From (SELECT 20 *
From (Select the * from Sys_option ORDER BY sys_id desc) t1) T2
ORDER BY sys_id ASC