SELECT COLUMN_NAME AS 列名, cast(COLUMN_TYPE as CHAR) AS 数据类型, cast(DATA_TYPE as CHAR) AS 字段类型, CHARACTER_MAXIMUM_LENGTH AS 长度, IS_NULLABLE AS 是否为空, COLUMN_DEFAULT AS 默认值, COLUMN_COMMENT AS 备注 FROM INFORMATION_SCHEMA. COLUMNS WHERE table_schema = 'tobacco_asset' AND table_name = 'asset_base'
这样可以查出对应的表格每个字段的信息