3
Mysql获取表的comment字段
source link: http://abcdxyzk.github.io/blog/2022/08/08/mysql-comment/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Mysql获取表的comment字段
2022-08-08 21:41:00
https://www.cnblogs.com/xiaogou/p/9178207.html
1.查看获取表内字段注释:
show full columns from tablename;
show full fields from tablename;
或是,在元数据的表里面看
select COLUMN_NAME 列名, DATA_TYPE 字段类型, COLUMN_COMMENT 字段注释
from INFORMATION_SCHEMA.COLUMNS
Where table_name = 'companies'##表名
AND table_schema = 'testhuicard'##数据库名
AND column_name LIKE 'c_name'##字段名
查看表注释的方法:
show create table tablename;
修改表的注释:
alter table test1 comment '修改后的表的注释';
修改字段的注释:
alter table test1 modify column field_name int comment '修改后的字段注释';
Posted by kk
2022-08-08 21:41:00tools, mysql
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK