In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Mysql uses limit paging
Select * from stu limit m, n; / m = (startPage-1) * pageSize,n = pageSize
PS:
(1) the first parameter value m represents the starting line, and the second parameter indicates how many rows are taken (page size)
(2) m = (2-1) * 10 ~ 1, which means that limit 11 ~ 10 starts at 11 lines and takes 10 rows, that is, page 2 data.
(3) the values of m and n parameters cannot be written in the statement, and the values must be calculated before they are written to the statement.
2. Oracle uses rownum for paging
Select * from (select rownum rn,a.* from table_name a where rownum = y; / / starting line, y = (startPage-1) * pageSize+1
PS:
(1) > = y rownum 1, when the first piece of data is queried and the value is 1, the condition is not met. Second, third. Similarly, the condition has not been met, so the result has not been returned. So when you query, you need to set an alias, and then call the alias to determine if the alias is greater than the value after the query is completed.
Summary
The above is the difference between Oracle and Mysql pages introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave a message for me, and the editor will reply you in time. Thank you very much for your support to the website!
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.