Mysql 获取表的comment 字段


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'##字段名

2-1查看表注释的方法:
> show  create  table  tablename;

修改表的注释:
alter table test1 comment '修改后的表的注释';

修改字段的注释:
alter table test1 modify column field_name int comment '修改后的字段注释';


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM