In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how to achieve paging query mysql, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!
The paging query statements of mysql are: 1, "select*from tablename limit index,pageNum" statement; 2, "select*from tablename limit pageNum offset index" statement.
The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.
The first kind:
Select * from tablename limit index,pageNum
Index indicates that the search starts with which item of data in the table; (note: the serial number of the first item of data is 0)
PageNum indicates how many pieces of data per page
The second kind:
Select * from tablename limit pageNum offset index
Index indicates that the search starts with which item of data in the table; (note: the serial number of the first item of data is 0)
PageNum indicates how many pieces of data per page
Note:
1. Database data calculation starts from 0.
2.offset X skips X data, limit Y selects Y data
X in 3.limit Xpenery Y means to skip X data and read Y data.
Both of them can do what they need, but there is a difference between them:
① starts the query from the third item in the database, takes one piece of data, that is, the third piece of data is read, and skips one or two items.
② queries two pieces of data from the second piece of data in the database, that is, the second and third pieces of data.
The above is all the contents of the article "how to achieve paging query in mysql". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.