SELECT TABLE_NAME '表名',TABLE_SCHEMA '数据库名',ORDINAL_POSITION '顺序',COLUMN_NAME '字段',DATA_TYPE '类型'
,CHARACTER_OCTET_LENGTH '字节长',IF(COLUMN_KEY='PRI',"√","") '主键',IF(EXTRA='auto_increment',"√","") '自增长'
,IF(IS_NULLABLE='YES',"√","") '空',CHARACTER_SET_NAME '编码',COLUMN_DEFAULT '默认值',COLUMN_COMMENT '说明'
FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='dzbbs' AND COLUMN_NAME='username'
#是查询数据库名为dzbbsdb的数据库中所有包含username列名的表信息。