zoukankan      html  css  js  c++  java
  • Mysql 查看表结构

    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的某几行的数据 

           

      

      

    请关于一下啦^_^

    微信公众号

  • 相关阅读:
    asp之缓存 cachestate
    ASP。net 之view
    ASP.net gridview之性别
    asp的gridview
    yii源码学习心得2
    yii源码学习心得
    什么是伪静态?伪静态有何作用?
    Yii2.0 时间日期插件之yii2-timepicker
    yii中调整ActiveForm表单样式
    8个新鲜的PHP常用代码
  • 原文地址:https://www.cnblogs.com/haloujava/p/11119645.html
Copyright © 2011-2022 走看看