当前位置:网站首页>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行的三条数据)
边栏推荐
猜你喜欢

Ping error: unknown name or service

Take you hand in hand to build Eureka server with idea

蓝桥ROS中使用fishros一键安装

机器人(自动化)等专业课程创新的结果

35岁那年,我做了一个面临失业的决定

95. (cesium chapter) cesium dynamic monomer-3d building (building)

Get started with mongodb
postgis学习

C method question 1

BSS 7230 flame retardant performance test of aviation interior materials
随机推荐
Jisuan Ke - t3104
ASP. Net open web page
Chisel tutorial - 04 Control flow in chisel
Rock-paper-scissors
C language learning
@Detailed introduction of configuration annotation
c—线性表
一个测试工程师的7年感悟 ---- 致在一路独行的你(别放弃)
Data analysis series 3 σ Rule / eliminate outliers according to laida criterion
Take you hand in hand to build Eureka client with idea
35岁那年,我做了一个面临失业的决定
一键免费翻译300多页的pdf文档
激光slam学习(2D/3D、偏实践)
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
P5594 [xr-4] simulation match
Resolve the URL of token
One click installation with fishros in blue bridge ROS
受限线性表
Oracle string sorting
HDU - 1260 tickets (linear DP)