select table_name,table_comment from information_schema.tableswhere table_schema ='bjsxt-his'
查看指定库下所有的表和表注释,字段和字段注释
selectdistinct
a.table_name as name,
a.table_comment ascomment,
b.COLUMN_NAME as columnname,
b.column_comment ascomment,
b.column_type as columntype,
b.column_key as columnkey
from information_schema.TABLES a leftjoin information_schema.COLUMNS b
on a.table_name = b.table_name
where a.table_schema ='bjsxt-his'
查看指定库下的表注释
selectdistinct
a.table_name as name,
a.table_comment ascomment,
b.COLUMN_NAME as columnname,
b.column_comment ascomment,
b.column_type as columntype,
b.column_key as columnkey
from information_schema.TABLES a leftjoin information_schema.COLUMNS b
on a.table_name = b.table_name
where a.table_schema ='bjsxt-his'and a.table_name ='sys_menu'
说明在 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.