当前位置:网站首页>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行的三条数据)
边栏推荐
猜你喜欢
Data Lake (XV): spark and iceberg integrate write operations
激光slam学习(2D/3D、偏实践)
Ora-02437 failed to verify the primary key violation
受限线性表
Uic564-2 Appendix 4 - flame retardant fire test: flame diffusion
Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
Svn relocation
Take you hand in hand to build Eureka server with idea
【LeetCode】20、有效的括号
Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
随机推荐
Access database query all tables SQL
串联二极管,提高耐压
Database interview questions + analysis
Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
SAP HR reward and punishment information export
C - linear table
C language greedy snake
2022.7.7-----leetcode.648
Oracle statistics by time
postgres timestamp转人眼时间字符串或者毫秒值
【LeetCode】20、有效的括号
C simple question one
Chisel tutorial - 05 Sequential logic in chisel (including explicit multi clock, explicit synchronous reset and explicit asynchronous reset)
二叉排序树【BST】——创建、查找、删除、输出
An example analysis of MP4 file format parsing
go time包常用函数
Possible SQL for Oracle table lookup information
Kubectl 好用的命令行工具:oh-my-zsh 技巧和窍门
May day C - most
Flash download setup