Linux 拨号vps windows公众号手机端

mysql怎么获取表中属性值

lewis 7年前 (2018-11-24) 阅读数 7 #VPS/云服务器
文章标签 mysql

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 = '字段名';

版权声明

本文仅代表作者观点,不代表米安网络立场。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

热门