SELECT
TABLE_NAME TABLE_NAME,
COLUMN_NAME COLUMN_NAME,
DATA_TYPE DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH DATA_LENGTH,
IS_NULLABLE NULLABLE,
COLUMN_KEY COLUMN_KEY,
COLUMN_COMMENT COMMENTS
FROM
INFORMATION_SCHEMA. COLUMNS
WHERE
TABLE_NAME = 'DP_ADMIN_PUNISH'
AND TABLE_SCHEMA = 'icp_business'
查询的是 icp_business数据库中表名为DP_ADMIN_PUNISH的 表明、列名、数据类型、数据的长度、是否为空、是否是主键、注释信息
效果如下图