Mysql 查看表注释或字段注释 查看所有表的注释 SELECTtable_name 表名,table_comment 表说明FROMinfORMation_schema.TABLESWHER
SELECTtable_name 表名,table_comment 表说明FROMinfORMation_schema.TABLESWHEREtable_schema = '数据库名'ORDER BYtable_name
SELECTa.table_name 表名,a.table_comment 表说明,b.COLUMN_NAME 字段名,b.column_comment 字段说明,b.column_type 字段类型,b.column_key 约束FROMinformation_schema. TABLES aLEFT JOIN information_schema. COLUMNS b ON a.table_name = b.TABLE_NAMEWHEREa.table_schema = '数据库名'ORDER BYa.table_name
select COLUMN_NAME 字段名,column_comment 字段说明,column_type 字段类型,column_key 约束 from information_schema.columns where table_schema = '数据库名'and table_name = '表名' ;
或者
show full columns from 表名;
注意表名不加单引号
show create table 表名;
create table t_user( ID INT(19) primary key auto_increment comment '主键', NAME VARCHAR(300) comment '姓名', CREATE_TIME date comment '创建时间')comment = '用户信息表';
修改表注释
alter table t_user comment = '修改后的表注释信息(用户信息表)';
修改字段注释
alter table t_user modify column id int comment '主键ID';
原文链接:https://www.jianshu.com/p/e6286174d35c
来源地址:https://blog.csdn.net/qq_53098203/article/details/129581942
--结束END--
本文标题: Mysql 查看表注释或字段注释
本文链接: https://www.lsjlt.com/news/421526.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-04-26
2024-04-26
2024-04-26
2024-04-26
2024-04-26
2024-04-26
2024-04-24
2024-04-24
2024-04-24
2024-04-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0