MySQL下读取 表/字段 的说明备注信息
SELECT
column_name AS `列名`,
data_type AS `数据类型`,
character_maximum_length AS `字符长度`,
numeric_precision AS `数字长度`,
numeric_scale AS `小数位数`,
is_nullable AS `是否允许非空`,
CASE WHEN extra = 'auto_increment'
THEN 1 ELSE 0 END AS `是否自增`,
column_default AS `默认值`,
column_comment AS `备注`
FROM
Information_schema.columns
WHERE
table_Name='表名';
column_name AS `列名`,
data_type AS `数据类型`,
character_maximum_length AS `字符长度`,
numeric_precision AS `数字长度`,
numeric_scale AS `小数位数`,
is_nullable AS `是否允许非空`,
CASE WHEN extra = 'auto_increment'
THEN 1 ELSE 0 END AS `是否自增`,
column_default AS `默认值`,
column_comment AS `备注`
FROM
Information_schema.columns
WHERE
table_Name='表名';
posted on 2012-05-08 12:26 alronzhang 阅读(463) 评论(0) 编辑 收藏 举报