mysql获取表属性值的方法
1.查询数据表中所有字段的属性
select * from information_schema.columns
where table_schema= '数据库库名' and table_name = '表名'
2.查询数据库中所有字段的属性
select * from information_schema.columns
where table_schema= '数据库库名'
3.查询数据库中特定列条件字段的属性
select table_schema,table_name,column_name,column_type,column_comment
from information_schema.columns
where TABLE_SCHEMA='数据库名' and column_name = '字段名';
亿速云「云数据库 MySQL」免部署即开即用,比自行安装部署数据库高出1倍以上的性能,双节点冗余防止单节点故障,数据自动定期备份随时恢复。点击查看>>
推荐阅读:java中怎么通过反射获取属性值