我想复制一个数据库中包含的表,然后插入到另一个数据库表中 [英] I want to copy table contained from one database and insert onto another database table

查看:116
本文介绍了我想复制一个数据库中包含的表,然后插入到另一个数据库表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将表的架构以及该表中的数据复制到实时服务器上另一个数据库中的另一个数据库表中.我该怎么办?

I want to copy a table's schema as well as the data within that table to another database table in another database on a live server. How could I do this?

推荐答案

如果要将表从一个数据库复制到另一个数据库,只需执行以下操作.

If you want to copy a table from one Database to another database , You can simply do as below.

CREATE TABLE db2.table LIKE db1.table;
INSERT INTO db2.table SELECT * FROM db1.table;

这篇关于我想复制一个数据库中包含的表,然后插入到另一个数据库表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆