To give you an idea: to use a feature of MySQL to achieve the page display of MySQL query results

Source: Internet
Author: User
Tags mysql mysql query query first row
mysql| Page | shows that a feature of the SELECT statement in MySQL makes it easy to implement the paging of the query results, and the syntax of the SELECT statement:
SELECT [Straight_join] [Sql_small_result] [Sql_big_result] [high_priority]
[DISTINCT | Distinctrow | ALL]
Select_expression,...
[into outfile ' file_name ' export_options]
[From Table_references
][where Where_definition]
[GROUP by Col_name,...]
[Having where_definition]
[ORDER BY {Unsigned_integer | col_name | formula}] [ASC | DESC],...]
[LIMIT] [Offset,] rows]
[PROCEDURE Procedure_name]]
The limit clause can be used to limit the number of data returned by the SELECT statement, which has one or two arguments, and if two arguments are given,
The first parameter specifies the position of the first row returned in all data, starting at 0 (note not 1), and the second parameter specifying a maximum return row
Number. For example:
SELECT * FROM Table LIMIT 5, 10; #返回第6-15 rows of data
SELECT * FROM table LIMIT 5; #返回前5行
SELECT * FROM table LIMIT 0, 5; #返回前5行

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.