mysql 查询表结构

查看表中字段的结构信息 

  可以用来查看表中字段的注释等,比如

select  table_name,column_name,column_comment  from information_schema.columns where table_schema ='表所在的库'  and table_name = '要查看的表名' ;

查看库里面表的结构信息  

  可以用来查看表的注释信息

  select table_name,table_comment from information_schema.tables where table_schema = '表所在的库' and table_name ='表名' ;

  去掉 table_name 限定条件,即可查看指定库中的所有表信息

猜你喜欢

转载自www.cnblogs.com/zhang-wenbin/p/12956091.html
今日推荐