Mysql 查看标结构
时间:2019-07-02 12:23:33
收藏:0
阅读:129
0.首先要有一张表,这里创建一张学生表
create table t_student(
id int primary key auto_increment,
name varchar(20) not null comment ‘姓名‘
)Engine=InnoDB default charset utf8;
1.利用describe
describe t_student;
describe t_student ‘%na%‘; 模糊查询列名为na的某几行的数据
describe 的简写形式 desc , 两个是等价的
2. 利用explain
explain t_student;
3. show columns from 表名
show columns from t_student;
show columns from t_student like ‘%name%‘; 模糊查询列名为name的某几行的数据
4. show fields from 表名
show fields from t_student;
show fields from t_student like ‘%name%‘; 模糊查询列名为name的某几行的数据
原文:https://www.cnblogs.com/haloujava/p/11119645.html
评论(0)