Home >Database >Mysql Tutorial >How to query the first 30 data in mysql

How to query the first 30 data in mysql

王林
王林Original
2020-10-16 10:35:564073browse

In mysql, you can query the first 30 data by executing the [SELECT * FROM data table name LIMIT 0, 30;] statement. LIMIT in this statement can receive one or two numeric parameters, but the parameters must is an integer constant.

How to query the first 30 data in mysql

The operating environment of this article: Windows7 system, Dell G3 computer, mysql8.

SQL statement:

SELECT * FROM  表  LIMIT 0, 30

LIMIT receives one or two numeric parameters.

The parameter must be an integer constant. If two parameters are given, the first parameter specifies the offset of the first returned record row, and the second parameter specifies the maximum number of returned record rows. The offset of the initial record row is 0 (not 1).

(Recommended tutorial: mysql video tutorial)

The above is the detailed content of How to query the first 30 data in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn