获取MySql元数据
获取某个数据库下的所有表名信息
select table_name from information_schema.tables where table_schema='数据库表名'
获取某个库某个表的字段信息
select ORDINAL_POSITION as Colorder,Column_Name as ColumnName,COLUMN_COMMENT as DeText
from information_schema.columns where table_schema = '数据库名称' and table_name = '表名'
order by ORDINAL_POSITION asc
获取某个库某个表的字段相关元数据信息
select COLUMN_NAME,DATA_TYPE,COLUMN_COMMENT,COLUMN_KEY,EXTRA from information_schema.columns where table_schema='库名' and table_name= '表名'
获取某个库某个表的表相关元数据信息
select TABLE_NAME,TABLE_COMMENT from information_schema.tables where table_schema = '库名' and table_name = '表名'
批量查询后插入
Insert into 表(字段1,字段2) select 字段1,字段2 from 表