MySQL Alternative paging method

Source: Internet
Author: User

Mysql>SelectSql_calc_found_rowsID, rankname,control,action from Xin_rank whereID< -Limit0,Ten;Selectfound_rows (); +----+-----------------+---------+--------+|ID| Rankname | Control | Action |+----+-----------------+---------+--------+|1| Account Management | admin | Manage | |2| Administrator Management | admin | L | |3| Admin Save | admin | Save | |4| Admin Edit | admin | Edit | |5| Admin Add | admin | Add | |6| Admin Delete | admin | del | |7| Admin View | admin | View | |8| Role Management | Role | L | |9| Role Saving | Role | Save | |Ten| Role Editing | Role | Edit |+----+-----------------+---------+--------+TenRowsinchSet (0.00sec)+--------------+| Found_rows () |+--------------+| the|+--------------+1RowinchSet (0.00Sec

The general paging is made up of two SQL statements, one is the record of the current page that matches the criteria, and one is the total number of records that are eligible for the query.

But there is only one SQL statement above, you can implement paging + query. Niubi

Reference Documentation:

http://blog.csdn.net/onisland/article/details/5729549

http://blog.csdn.net/qq_17271573/article/details/48312195

MySQL Alternative paging method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.