Home  >  Article  >  Database  >  How to query the first 20 records in mysql

How to query the first 20 records in mysql

王林
王林Original
2020-09-02 13:39:517366browse

Mysql method to query the first 20 records: 1. Execute the [select * from no_primary_key order by id limit 10;] command to view; 2. Execute the [show create table...] command to view the table structure.

How to query the first 20 records in mysql

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

Specific method:

If you want to display the first 20 records from id=1 to id=20, execute the command:

select * from no_primary_key order by id limit 10;

Display 20 of the records at will

select * from no_primary_key limit 20;

Note: sel cannot be used instead of select; but desc can be used instead of describe;

desc no_primary_key;
show create table no_primary_key; # 显示详细表结构

(Video tutorial recommendation: mysql video tutorial)

The above is the detailed content of How to query the first 20 records 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