ELECT
    COLUMN_NAME 字段名称,
    COLUMN_TYPE 数据类型,
IF
    ( IS_NULLABLE = 'NO', '是', '否' ) AS '必填',
    COLUMN_COMMENT 注释 
FROM
    INFORMATION_SCHEMA.COLUMNS 
WHERE
    table_schema = 'srms' 
    AND table_name = 'base_user_role';

李春雨
325 声望188 粉丝