当前位置:网站首页>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行的三条数据)
边栏推荐
- C语言学习
- Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
- Laser slam learning (2d/3d, partial practice)
- C method question 1
- Navicat connects Oracle
- Ping error: unknown name or service
- Take you hand in hand to build Eureka server with idea
- Rectification characteristics of fast recovery diode
- Possible SQL for Oracle table lookup information
- 关于CH32库函数与STM32库函数的区别
猜你喜欢
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
Get started with mongodb
One click free translation of more than 300 pages of PDF documents
Laser slam learning (2d/3d, partial practice)
MongoDB快速入门
MP4文件格式解析之结合实例分析
[path planning] use the vertical distance limit method and Bessel to optimize the path of a star
35岁那年,我做了一个面临失业的决定
Binary sort tree [BST] - create, find, delete, output
The file format and extension of XLS do not match
随机推荐
Download AWS toolkit pycharm
一鍵免費翻譯300多頁的pdf文檔
DataGuard active / standby cleanup archive settings
C - Fibonacci sequence again
Traduction gratuite en un clic de plus de 300 pages de documents PDF
Is it safe for tongdaxin to buy funds?
One click free translation of more than 300 pages of PDF documents
Alibaba cloud MySQL cannot connect
激光slam学习(2D/3D、偏实践)
Idea automatically generates serialVersionUID
postgis学习
Ora-01741 and ora-01704
HDU - 1260 tickets (linear DP)
[path planning] use the vertical distance limit method and Bessel to optimize the path of a star
P5594 [xr-4] simulation match
Binary sort tree [BST] - create, find, delete, output
Apng2gif solutions to various problems
HB 5469 combustion test method for non-metallic materials in civil aircraft cabin
0-1 knapsack problem
Archery installation test