Assuming that this is page pageno, there are pagesize records per page, and now the student table is queried using MySQL, Oracle, and SQL Server paging.
1. mysql Paging query:
1 SELECT 2 * 3 from 4 student5-1* pagesize,pagesize;
Understanding: (Limit n,m) + starts from the nth line to fetch M Records, n from 0 to calculate.
2, Oracel paged query:
1 SELECT2 *3 from4 (5 SELECT6ROWNUM RN,*7 from8 Student9 WHERETenRownum<=PageNo*pageSize One ) A WHERE -Rn>(PageNo- 1)*PageSize
Understanding: Suppose PageNo = 1,pagesize = 10, first take the row number less than or equal to 10 from the student table, and then remove the RN greater than 0 records from these records, so as to achieve paging purposes. RowNum starting from 1.
3. SQL Server Paging query:
1 SELECT2 TOPPageSize*3 from4 (5 SELECT6Row_number () Over(ORDER byIdASC) RowNumber,*7 from8 Student9 ) ATen WHERE OneA.rownumber>(PageNo- 1)*PageSize
Understanding: Suppose PageNo = 1,pagesize = 10, sort by the ID of the student table first, rownumber as the line number, and then take out 10 records starting at line 1th.
Paged query Some of the database may have several ways, here may not be the most efficient way to query, but this is the most convenient paging query I use, if interested can also be used in other paged query the way to study.
Paged query statements for MySQL, Oracle, and SQL Server