当前位置:Gxlcms > 数据库问题 > sql获取mysql所有数据库,表名

sql获取mysql所有数据库,表名

时间:2021-07-01 10:21:17 帮助过:129人阅读

select table_name from information_schema.TABLES where TABLE_SCHEMA=sw_wbdlp_basic_db_v1 and TABLE_TYPE = base table;

执行结果:

获取数据库名:

技术图片

 

 表名:

技术图片

 不同数据库备份复制表的sql

Sql server :
select * into table_new from table_old ; 复制结构和数据
select * into table_new from table_old where 1=2;只复制结构
Oracle:
create table table_new as select * from table_old;复制结构和数据
create table table_new as select * from table_old where 1=0;只复制结构
DB2:
--复制表结构
create table table_name_new as (select * from table_name_old) definition only;

 

sql获取mysql所有数据库,表名

标签:basic   取数据   type   mys   数据库备份   where   into   分表   ora   

人气教程排行