Mysql查询所有表+字段

先上代码

SELECT
t1.TABLE_SCHEMA,
t1.TABLE_NAME,
t2.TABLE_COMMENT,
t1.COLUMN_NAME,
t1.COLUMN_COMMENT,
t1.COLUMN_TYPE
FROM information_schema.COLUMNS t1
inner join information_schema.tables t2  on t1.TABLE_SCHEMA = t2.TABLE_SCHEMA  and t1.TABLE_NAME = t2.TABLE_NAME
WHERE t1.TABLE_NAME  NOT LIKE 'vw%'
and t1.TABLE_SCHEMA  not in ( 'information_schema' )
;

查询结果满足以下表格统计:

posted @ 2023-02-14 13:08  轻愁~  阅读(71)  评论(1编辑  收藏  举报