select column_name,column_comment,data_type from information_schema.columns where table_name='查询表名称'
通过以上语句可以查到数据库表的字段属性
其中column_name表示查询字段名
column_comment表示查询字段备注
data_type表示查询字段类型
完整信息如下所示
select * from information_schema.columns where table_name='查询表名称' and table_schema='数据库名称'
其中(and table_schema='数据库名称')可以不写,表示默认使用当前数据库
————————————————
版权声明:本文为CSDN博主「猫儿不哭」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_40803316/article/details/84656511