mysql 字段的注释有什么用

mysql 字段的注释有什么用,第1张

有的,用如下方法 1 创建表的时候写注释 create table test1 ( field_name int comment '字段的注释' )comment='表的注释'; 2 修改表的注释 alter table test1 comment '修改后的表的注释';

看看这些里面有没有你要的
/[15:04:35][   0 ms]/ Set names 'utf8'
/[15:04:35][   0 ms]/ set sql_mode=''
/[15:04:35][  47 ms]/ use `indicator`
/[15:04:35][   0 ms]/ show table status from `indicator` where engine is not NULL
/[15:04:36][   0 ms]/ describe `indicator``des_indicator_reg`
/[15:04:36][  31 ms]/ show index from `indicator``des_indicator_reg`
/[15:04:46][   0 ms]/ show full fields from `indicator``des_indicator_reg`
/[15:04:46][   0 ms]/ show keys from `indicator``des_indicator_reg`
/[15:04:46][   0 ms]/ show create table `indicator``des_indicator_reg`
/[15:04:56][   0 ms]/ show full fields from `indicator``des_indicator_reg`
/[15:04:56][  15 ms]/ show keys from `indicator``des_indicator_reg`
/[15:04:56][   0 ms]/ select  from `indicator``des_indicator_reg`  limit 0, 50
/[15:05:13][   0 ms]/ describe `indicator``des_indicator_reg` 
/[15:05:27][   0 ms]/ show full fields from `indicator``des_indicator_reg`

navicat没有你要求的功能,你可以通过这两种方式查看注释:
1、右键一个表,选择“对象属性”,下面会出现东西,选择“DDL”
2、右键一个表,选择“设计表”,快捷键是ctrl+d

ALTER TABLE table_name COMMENT='这是表的注释';

1给表加注释:

ALTER TABLE table_name COMMENT='这是表的注释';

2给列加注释:

ALTER table table_name MODIFY `column_name` datetime DEFAULT NULL COMMENT '这是字段的注释'


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12979277.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-29
下一篇 2023-05-29

发表评论

登录后才能评论

评论列表(0条)

保存