语法: 创建表时的COMMENT内容,要查看这些内容,使用命令: show full fields from '表名称'; 查看tb_usr表字段注释: 创建新表的脚本中, 可在字段定义脚本中添加comment属性来添加注释: create table test( id int not null default 0 comment '用户id' ) 修改表的注释 alter table test1 comment '修改后的表的注释'; 修改字段的注释 alter table test1 mod
原文:mysql通过字段注释查找字段名称 有时候表的字段太多,只是大致记得表的注释,想通过字段注释查找字段名称,可以用如下语句: SELECT COLUMN_NAME,column_comment FROM INFORMATION_SCHEMA.Columns WHERE table_name='tj_record' AND table_schema='tianjin_20140811' AND column_comment LIKE '%数据是否有效%' 其中table_schema为数据库
转自:http://www.2cto.com/database/201202/119996.html 在MySQL下运行完下面这个建表语句后. 如何从数据字典中,检索出这个表的字段的相关信息? DROP TABLE IF EXISTS test_table; CREATE TABLE test_table( Test_ID int NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT '主键(自增长)', Test_Key varchar(10) NOT NUL
在MySQL数据库中, 字段或列的注释是用属性comment来添加. 创建新表的脚本中, 可在字段定义脚本中添加comment属性来添加注释. 示例代码如下: create table test( id int not null default 0 comment '用户id' ) 如果是已经建好的表, 也可以用修改字段的命令,然后加上comment属性定义,就可以添加上注释了. 示例代码如下: alter table test change column id id int not null