当前位置:网站首页>limit 与offset的用法(转载)
limit 与offset的用法(转载)
2022-07-07 21:54:00 【流楚丶格念】
limit 与offset的用法
在mysql中一般使用limit来实现分页
1、LIMIT后面跟一个参数,表示要提取的数量。
如 :select* from test LIMIT 3 指提取前三条数据,类似sqlServer的top语法。
2、LIMIT后面跟两个参数时,第一个参数是指第几行,第二个参数是取几条数据。
如: select * from test limit 2,3; 这个SQL是指从第二行的下一行开始向下取3条数据。(即取:3,4,5行的三条数据)
3、LIMIT和OFFSET组合使用时,LIMIT后面只能有一个参数,表示要提取的数量,offset后面的数字则表示第几行。
如:select * from test LIMIT 3 offset 2; 这个SQL是指从第二行的下一行开始向下取3条数据。(即取:3,4,5行的三条数据)
边栏推荐
猜你喜欢

Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)

About the difference between ch32 library function and STM32 library function

Ora-02437 failed to verify the primary key violation

一鍵免費翻譯300多頁的pdf文檔

一份假Offer如何盗走了「Axie infinity」5.4亿美元?

一键免费翻译300多页的pdf文档

At the age of 35, I made a decision to face unemployment

Chisel tutorial - 03 Combinatorial logic in chisel (chisel3 cheat sheet is attached at the end)
PostGIS learning
![Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer](/img/1f/cd38b7c6f00f2b3e85d4560181a9d2.png)
Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer
随机推荐
Take you hand in hand to build Eureka server with idea
Database interview questions + analysis
Stringutils tool class
Svn relocation
正畸注意事项(持续更新中)
P1308 [noip2011 popularity group] count the number of words
AITM3.0005 烟雾毒性测试
【汇总】看过的一些Panel与视频
P2141 [noip2014 popularization group] abacus mental arithmetic test
平衡二叉树【AVL树】——插入、删除
Chisel tutorial - 05 Sequential logic in chisel (including explicit multi clock, explicit synchronous reset and explicit asynchronous reset)
二叉排序树【BST】——创建、查找、删除、输出
Resolve the URL of token
Where are you going
Access database query all tables SQL
Uic564-2 Appendix 4 - flame retardant fire test: flame diffusion
HDU - 1260 Tickets(线性DP)
Magic fast power
An example analysis of MP4 file format parsing
HB 5469民用飞机机舱内部非金属材料燃烧试验方法