MYSQL导出数据字典

SELECT
	t.COLUMN_NAME AS '字段名',
	t.COLUMN_TYPE AS '数据类型',
	CASE IFNULL(t.COLUMN_DEFAULT, 'Null') WHEN '' THEN '空字符串' WHEN 'Null' THEN 'NULL' ELSE t.COLUMN_DEFAULT END AS '默认值',
	CASE t.IS_NULLABLE WHEN 'YES' THEN '是'
	ELSE '否' END AS '是否允许为空',
 	t.COLUMN_COMMENT AS '字段说明'
FROM
	information_schema. COLUMNS t
WHERE
	t.TABLE_SCHEMA = '数据库名称' 
	AND t.TABLE_NAME = '表名';

image
image
image
image

https://blog.csdn.net/c5211314963/article/details/132089629
https://blog.csdn.net/weixin_55928290/article/details/138059993
https://blog.csdn.net/wuyanwenyun/article/details/134876327

posted @ 2024-12-17 13:35  yub4by  阅读(4)  评论(0编辑  收藏  举报