当前位置:网站首页>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行的三条数据)
边栏推荐
- AWS AWS help error
- [leetcode] 20. Valid brackets
- The file format and extension of XLS do not match
- Pycharm basic settings latest version 2022
- Balanced binary tree [AVL tree] - insert, delete
- Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
- Jisuan Ke - t3104
- Chisel tutorial - 01 Introduction to Scala
- Learn about scratch
- codeforces每日5题(均1500)-第八天
猜你喜欢
![Binary sort tree [BST] - create, find, delete, output](/img/e4/a950607f8b76bc7f8d56063dd72126.png)
Binary sort tree [BST] - create, find, delete, output

Ora-02437 failed to verify the primary key violation
![P1067 [noip2009 popularity group] polynomial output (difficult, pit)](/img/1f/a798879a0d65eccefa339b288f2102.jpg)
P1067 [noip2009 popularity group] polynomial output (difficult, pit)

【LeetCode】20、有效的括号

MySQL Architecture

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

Ora-01741 and ora-01704

HB 5469 combustion test method for non-metallic materials in civil aircraft cabin

SAP HR social work experience 0023

C number of words, plus ¥, longest word, average value
随机推荐
gorm 关联关系小结
One click installation with fishros in blue bridge ROS
Traduction gratuite en un clic de plus de 300 pages de documents PDF
Ora-02437 failed to verify the primary key violation
P1067 [noip2009 popularity group] polynomial output (difficult, pit)
ASP. Net query implementation
蓝桥ROS中使用fishros一键安装
Dependency injection
Access database query all tables SQL
Restricted linear table
【leetcode】day1
Postgres timestamp to human eye time string or millisecond value
一份假Offer如何盗走了「Axie infinity」5.4亿美元?
Learn about scratch
Wechat applet development beginner 1
UIC564-2 附录4 –阻燃防火测试:火焰的扩散
C simple question 2
Take you hand in hand to build Eureka client with idea
C - Fibonacci sequence again
【实验分享】通过Console口登录到Cisco设备