mysql查询数据库中包含某字段(列名)的所有表

时间:2022-09-15 13:49:17

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='fromflow' AND COLUMN_NAME='explan3'