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

How to query the first 20 records in mysql

王林
Release: 2021-04-15 10:37:51
Original
7375 people have browsed it

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

Display 20 of the records at will

select * from no_primary_key limit 20;
Copy after login

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; # 显示详细表结构
Copy after login

(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!

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