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