MySQL比较好用的【数据字典】生成脚本^_^

SELECT
    a.TABLE_SCHEMA "库名",
    a.TABLE_NAME "表名",
    a.COLUMN_NAME "列名",
    a.COLUMN_TYPE "类型",
    a.COLUMN_DEFAULT "默认值",
    a.IS_NULLABLE "是否为空",
    a.CHARACTER_SET_NAME "表字符集",
    a.COLLATION_NAME "校验字符集",
    CONCAT( a.COLUMN_COMMENT, a.COLUMN_KEY, a.EXTRA ) "列备注",
    b.TABLE_COMMENT "表备注",
    b.ENGINE "引擎" 
FROM
    information_schema.COLUMNS a,
    information_schema.TABLES b 
WHERE
    a.TABLE_SCHEMA = b.TABLE_SCHEMA 
    AND a.TABLE_SCHEMA IN ( xx, xxx, xxxx ) 
    AND a.TABLE_NAME = b.TABLE_NAME 
ORDER BY
    a.TABLE_SCHEMA,
    a.TABLE_NAME,
    a.ORDINAL_POSITION

 

MySQL比较好用的【数据字典】生成脚本^_^

上一篇:Flink sql 流式去重


下一篇:SQLServer锁原理和锁的类型