- 查看 app 数据库的所有表注释
SELECT
TABLE_NAME,
TABLE_COMMENT
FROM
information_schema.TABLES
WHERE
table_schema = 'app';
- 查看 app 数据库下 test 表的所有字段注释
SELECT
COLUMN_NAME,
column_comment
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
table_name = 'test'
AND table_schema = 'app'