mysql查看表注释和字段注释

  • 说明在 mysql中information_schema这个数据库中保存了mysql中所有的数据库信息,
  • 查看库中所有表和对应的注释
select table_name,table_comment from information_schema.tables where table_schema = 'bjsxt-his'
  • 查看指定库下所有的表和表注释,字段和字段注释
select distinct 
a.table_name as name,
a.table_comment as comment,
b.COLUMN_NAME as columnname,
b.column_comment as comment,
b.column_type as columntype,
b.column_key as columnkey
from information_schema.TABLES a left join information_schema.COLUMNS b
on a.table_name = b.table_name 
where a.table_schema = 'bjsxt-his'
  • 查看指定库下的表注释
select distinct 
a.table_name as name,
a.table_comment as comment,
b.COLUMN_NAME as columnname,
b.column_comment as comment,
b.column_type as columntype,
b.column_key as columnkey
from information_schema.TABLES a left join information_schema.COLUMNS b
on a.table_name = b.table_name 
where a.table_schema = 'bjsxt-his' and a.table_name = 'sys_menu'
  • 学习源
    https://blog.csdn.net/weixin_39025362/article/details/108337016?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_paycolumn_v3&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_paycolumn_v3&utm_relevant_index=1
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值