MySQL 查看表结构简单命令。 一、简单描述表结构,字段类型desc tabl_name; 显示表结构,字段类型,主键,是否为空等属性,但不显示外键。 二、查询表中列的注释信息 select * from information_schema.columns where table_schema = 'db' #表所在数据库 and table_name = 'tablename' ; #你要查的表 三、只查询列名和注释 select column_name, column_comment from information_schema.columns where table_schema ='db' and table_name = 'tablename' ; 四、#查看表的注释 select table_name,table_comment from information_schema.tables where table_schema = 'db' and table_name ='tablename' ps:二~四是在元数据表中查看,我在实际操作中,常常不灵光,不知为什么,有了解的大侠请留印。 五、查看表生成的DDL show create table table_name;
0
0
相关文章
mysql执行SQL语句时的优化与查询重写
mysql查询条件顺序会影响索引吗_mysql查询条件顺序解析
mysql执行SQL时如何访问存储引擎_mysql分层架构说明
limit语法在不同位置有什么影响_mysql分页规则说明
mysql主从复制中的数据冲突与冲突解决方法
相关标签:
本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门AI工具









