mysql只显示表名和备注


查看某个数据下的表及其备注:

select table_name,table_comment from information_schema.tables  where table_schema='db' ;

只要改后面的table_schema为你的数据库名

结果:

 查看某个表下的字段及其备注

desc 表名;
show columns from 表名;
describe 表名;
show create table 表名;
select COLUMN_NAME,COLUMN_COMMENT
from
INFORMATION_SCHEMA.Columns
where
table_name = '表名'
and table_schema='数据库名'
 
INFORMATION_SCHEMA.Columns:
TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME, COLUMN_TYPE, COLUMN_KEY

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM