Loading

表结构转excel

1.查询表名 like ...的表

select table_name,table_comment from information_schema.tables where table_schema='onecloud' and table_name like 'oc_%_instance';

2.表结构转excel

SELECT
t.table_name ,
t.table_comment,
c.COLUMN_NAME 列名,
c.COLUMN_TYPE 数据类型,
c.DATA_TYPE 字段类型,
c.COLUMN_DEFAULT 默认值,
c.COLUMN_COMMENT 备注
FROM
INFORMATION_SCHEMA.COLUMNS c,information_schema.TABLES t
where c.TABLE_NAME = t.TABLE_NAME
and t.table_schema ='onecloud'
and t.table_name in ('aaa','bbb','ccc')

posted @ 2019-12-24 18:58  风萧萧5  阅读(425)  评论(0编辑  收藏  举报