SELECT TABLE_NAME AS '表名',
       COLUMN_NAME AS '字段名',
       DATA_TYPE AS '数据类型',
       COLUMN_COMMENT AS '字段注释',
       IS_NULLABLE AS '允许空值',
       COLUMN_DEFAULT AS '默认值',
       character_maximum_length as '字符长度',
       numeric_precision as '数字精度',
       numeric_scale as '小数位数',
       column_type as '字段类型'
  FROM information_schema.COLUMNS t
 WHERE TABLE_SCHEMA = '数据库名称'
 ORDER BY TABLE_NAME, ORDINAL_POSITION;

标签: none

评论已关闭