当前位置:网站首页>Detailed sorting of Oracle and MySQL pages
Detailed sorting of Oracle and MySQL pages
2022-06-22 08:17:00 【Hanxiaozhi】
Database Paging SQL sentence :
I don't say much nonsense , Go straight to the code ,Orcle and Mysql Paging formula for
①:MySQL Pagination ,select * from emp limit m,n;(m Indicates the starting index of the query data ,n Indicated from m+1 strip Inquire about n strip )
1. Paging requirements each page 3 strip , Query the first 2 page
page = 2;
pageSize =3;
2. The formula
Starting index
startIndex = (page-1)*pageSize
Maximum number per page
maxCount = pageSize;
3.sql example
select * from emp limit satrtIndex,maxCount;
②:Orcle Pagination
1. Paging requirements each page 3 strip , Query the first 2 page
page =2;
pageSize =3;
2. The formula
Start line number
startRownum = (page-1)*pageSize+1;
End line number
endRownum = page*pageSize;
3.sql example
select * from (select rownum r,t.* from emp t where rownum <=6) where r>=4;
select * from (select rownum r,t.* from emp t where rownum <=endRownum ) where r>=startRownum ;
③: Summarize paging again :
1.MySQL: use limit keyword
2.Orcle: use rownum Line number to page
边栏推荐
- Mt4/mql4 getting started to be proficient in EA tutorial lesson 7 - common functions of MQL language (VII) - index value taking function
- 【 Oracle database】 Nursery Mother Tutorial day13 date Function
- 【Oracle 数据库】奶妈式教程 day14 转换函数
- C # read / write TXT file to listview
- 歪门邪道之解决首屏图片加载闪烁问题
- How to design the dead shot, the best and eye-catching performance of the watch Vanguard
- Oracle gets the working day time between two dates
- 【Oracle 數據庫】奶媽式教程 day13 日期函數
- MySQL query database capacity
- Bee framework, an ORM framework that can be learned in ten minutes --bee
猜你喜欢
关于菲涅尔现象

Mt4/mql4 getting started to be proficient in EA tutorial lesson 7 - common functions of MQL language (VII) - index value taking function

Mt4/mql4 getting started to mastering EA tutorial lesson 3 - common functions of MQL language (III) - common functions of K-line value taking

并发三大特性2-有序性

Mt4/mql4 getting started to mastering EA tutorial lesson 4 - common functions of MQL language (IV) - common functions of K-line value

第八章 Web项目测试(此章完结)

Mt4/mql4 getting started to mastering EA tutorial lesson 5 - common functions of MQL language (V) - common functions of account information

Stored procedures and functions of MySQL

Learn data warehouse together - Zero

Characteristics of industrial Internet
随机推荐
Calculation days ()
Sqlserver paging
关于菲涅尔现象
歪门邪道之解决首屏图片加载闪烁问题
Note pad replaces all contents after a character in all lines
PostgreSQL source code (56) extensible type analysis expandedobject/expandedrecord
Questions 1 to 100 of the national information security grade examination nisp level 1 question bank (1)
Permission Operation of MySQL
学科融合对steam教育的作用
Using KDJ metrics on MT4
Add, delete and modify easyUI data table
年度十强!赛宁网安再次入围《中国数字安全百强报告》
Installing SQL Server 2008 by image in Windows Service 2008
Example of multipoint alarm clock
C#实现语音朗读功能
Detailed explanation of the underlying principle of concurrent thread pool and source code analysis
第八章 Web项目测试(此章完结)
找出不是两个数组共有的元素
【Oracle 數據庫】奶媽式教程 day13 日期函數
C语言实现往MySQL插入和读取图片