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

           

      

      

    请关于一下啦^_^

    微信公众号

  • 相关阅读:
    phpexcel 字符串转码
    thinkphp 3.2 linux二级目录安装
    linux 系统、命令、软件
    thinkphp3.2和phpexcel导入
    苹果手机微信分享代码失效
    thinkphp3.2与phpexcel带图片生成 完美案例
    thinkphp3.2与phpexcel基础生成
    thinkphp 3.2加载类
    thinkphp 3.2与phpexcel
    thinkphp 导出exl功能
  • 原文地址:https://www.cnblogs.com/haloujava/p/11119645.html
Copyright © 2020-2023  润新知