sql生成表模型欄位
阿新 • • 發佈:2021-01-06
SELECT
b.TABLE_COMMENT as '表名',
-- a.TABLE_SCHEMA as tableSchema,
a.TABLE_NAME as tableName,
a.COLUMN_NAME as columnName,
a.COLUMN_DEFAULT as columnDefault,
a.IS_NULLABLE as isNullable,
a.COLUMN_TYPE as columnType,
a.COLUMN_COMMENT as columnComment,
-- a.EXTRA as extra,
from information_schema.COLUMNS a
LEFT JOIN information_schema.TABLES b ON a.TABLE_NAME=b.TABLE_NAME
where a.TABLE_SCHEMA='acctdb'
ORDER BY b.TABLE_NAME