查询mysql表的字段详情

select column_name as 字段类型,
column_type as 数据类型,
data_type as 字段类型,
character_maximum_length as 长度,
is_nullable as 是否为空,
column_default as 默认值,
column_comment as 备注
from
information_schema.columns
where
table_schema = '数据库名' and table_name = '表名';
posted @ 2022-02-09 15:11  iaxusyy  阅读(67)  评论(0编辑  收藏  举报