获取MySql元数据

获取某个数据库下的所有表名信息

select * from information_schema.tables where table_schema='库名称'

获取某个库某个表的字段信息

select * from information_schema.columns where table_schema = '数据库名称' and table_name = '表名' order by ORDINAL_POSITION asc

批量查询后插入

Insert into 表(字段1,字段2) select 字段1,字段2 from 表

posted @ 2022-03-23 17:43  黄河大道东  阅读(84)  评论(0编辑  收藏  举报