分享知識-快樂自己:查看錶註釋 以及 欄位註釋
阿新 • • 發佈:2018-12-30
--------------------------------------------原 mysql中檢視所有表、表字段、表註釋、欄位註釋----------------------------------
-----查詢所有表註釋
SELECT TABLE_NAME, TABLE_COMMENT
FROM INFORMATION_SCHEMA.Tables
WHERE table_schema ='dasoujia'
---------------
INFORMATION_SCHEMA.Tables:
TABLE_SCHEMA,TABLE_NAME,CREATE_TIME,UPDATE_TIME,CHECK_TIME,TABLE_COMMENT
--------------------------------------------------------------------------------------------------------------------------------
檢視所有欄位和欄位註釋
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