获取数据库中所有表及字段
获取test库中所有表名、表说明、字段、字段类型、字段说明
SELECT *
FROM (
select table_name,NULL column_name,'' COLUMN_TYPE,table_comment,1 sort
from information_schema.tables
where table_schema = 'test'
UNION ALL
select table_name,column_name,COLUMN_TYPE,column_comment,2 sort
from information_schema.columns
where table_schema ='test'
)t
ORDER BY t.TABLE_NAME,t.sort
;