Home  >  Article  >  Database  >  mysql中查询前10条记录_MySQL

mysql中查询前10条记录_MySQL

WBOY
WBOYOriginal
2016-06-01 13:38:482143browse

bitsCN.com


mysql中查询前10条记录

 

select * from no_primary_key order by id limit 10;

 

# 显示从id=1到id=10的前10条记录;  

 

select * from no_primary_key limit 10; # 随意显示其中10条记录; 

 

注意:不能用 sel 来代替 select; 但是可以用 desc 来代替 describe; 

 

desc no_primary_key;

 

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

bitsCN.com
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