在MySQL中将行从一个表复制到另一个表 [英] Copy rows from one table to another in MySQL

查看:141
本文介绍了在MySQL中将行从一个表复制到另一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个结构相同的表.我需要从一个表中选择数据,然后将它们存储到另一个表中.

I have two tables with the same structure. I need to select data from one table and have to store them into the other.

我该怎么做?

推荐答案

由于它们是相同的结构,因此您可以执行

Since they are the same structure then you can just do


insert into table1 select colum1, column2,... from table2

这篇关于在MySQL中将行从一个表复制到另一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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