Home > Database > Mysql Tutorial > body text

How to query the first 30 data in mysql

王林
Release: 2021-04-15 10:44:30
Original
4058 people have browsed it

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template