关于mysql:mysql-数据库字段表名-注释查询

44次阅读

共计 366 个字符,预计需要花费 1 分钟才能阅读完成。

SELECT
    TABLE_NAME "表名",
    COLUMN_NAME "字段名称",
    COLUMN_TYPE "字段类型长度",
IF
    (EXTRA = "auto_increment", CONCAT( COLUMN_KEY, "(", IF ( EXTRA = "auto_increment", "自增长", EXTRA), ")" ), COLUMN_KEY ) "主外键",
    IS_NULLABLE "空标识",
    COLUMN_COMMENT "字段阐明" 
FROM
    information_schema.COLUMNS 
WHERE
    TABLE_SCHEMA = 'gzh-test-sn';
SELECT
    TABLE_NAME "表名",
    TABLE_COMMENT "正文" 
FROM
    information_schema.TABLES 
WHERE
    TABLE_SCHEMA = 'gzh-test-sn';

正文完
 0