mysql獲取表屬性值的方法
1.查詢數(shù)據(jù)表中所有字段的屬性
select * from information_schema.columns
where table_schema= '數(shù)據(jù)庫庫名' and table_name = '表名'
2.查詢數(shù)據(jù)庫中所有字段的屬性
select * from information_schema.columns
where table_schema= '數(shù)據(jù)庫庫名'
3.查詢數(shù)據(jù)庫中特定列條件字段的屬性
select table_schema,table_name,column_name,column_type,column_comment
from information_schema.columns
where TABLE_SCHEMA='數(shù)據(jù)庫名' and column_name = '字段名';