SELECT '字段名称','数据类型','主键','备注'
UNION
SELECT
COLUMN_NAME as 字段名称,
COLUMN_TYPE as 数据类型,
if(COLUMN_KEY='PRI','Y','N') as 主键,
COLUMN_COMMENT as 备注
FROM
INFORMATION_SCHEMA. COLUMNS
WHERE
table_schema = '数据库名'
AND
table_name = '表名'
INTO OUTFILE 'D:/XXX.xls'
导出数据库表结构到excel
最新推荐文章于 2024-08-20 14:28:31 发布