失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > mysql查看表注释和字段注释

mysql查看表注释和字段注释

时间:2018-07-25 00:28:23

相关推荐

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 columnkeyfrom information_schema.TABLES a left join information_schema.COLUMNS bon 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 columnkeyfrom information_schema.TABLES a left join information_schema.COLUMNS bon a.table_name = b.table_name where a.table_schema = 'bjsxt-his' and a.table_name = 'sys_menu'

学习源

/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

如果觉得《mysql查看表注释和字段注释》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。