Mysql Limit Offset

Source: Internet
Author: User
Mysql Limit Offset

Suppose that there are 13 data in the database table student.

Statement 1:select * FROM student limit 9,4

Statement 2:slect * FROM student limit 4 offset 9

Statements 1 and 2 return rows 10th, 11, 12, 13 of the table student

4 in Statement 2 returns 4 rows, 9 means starting from row tenth of the table

paging function via limit and offset or limit only

Suppose Numberperpage represents the number of bars to display per page

pagenumber = page number

Then return to page pagenumber, each page of the number of Numberperpage SQL statement is written as

Statement 3:select * FROM studnet limit (pagenumber-1) *numberperpage,numberperpage

Statement 4:select * FROM student limit numberperpage offset (pagenumber-1) *numberperpage

Related Article

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.