Home >Database >Mysql Tutorial >How to query the first 30 data in mysql
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.
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!