发布于 1个月前

sql如何导出数据结构的表格数据字典

select COLUMN_NAME as 字段名,COLUMN_TYPE as 字段类型,IS_NULLABLE 是否为空,COLUMN_DEFAULT as 默认值,COLUMN_COMMENT as 字段说明 from information_schema.COLUMNS where TABLE_SCHEMA='数据库名' and TABLE_NAME='数据表名'

带表名的

select TABLE_NAME as 表名,COLUMN_NAME as 字段名,COLUMN_TYPE as 字段类型,IS_NULLABLE 是否为空,COLUMN_DEFAULT as 默认值,COLUMN_COMMENT as 字段说明 from information_schema.COLUMNS where TABLE_SCHEMA='数据库名' and TABLE_NAME='数据表名'

再利用 navicat 导出excel就行了

©2020 edoou.com   京ICP备16001874号-3