MYsql查看表类型 备注

SELECT
COLUMN_NAME,
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='BATTLEFIELD_DECISION'

posted @ 2017-06-12 11:43  珈子  阅读(580)  评论(0编辑  收藏  举报