如何将行从一个表复制到另一个表?

时间:2022-04-22 19:37:31

I have 2 table with same struture i need to select data from one table and have to store in to 2nd table.

我有2个具有相同结构的表我需要从一个表中选择数据并且必须存储到第二个表中。

4 个解决方案

#1


8  

Since they are the same structure then you can just do

因为它们是相同的结构,所以你可以做到


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

#2


15  

insert into tablea(id,name) select id,name from tableb;

#3


6  

leave out the values keyword

省略值关键字

insert into tbl1 
select * from tbl2

#4


5  

insert into blacklist 
select * 
from newblacklist

for uploading any single number

用于上传任何单个号码

insert into blacklist 
select * 
from newblacklist 
where numbers ='123456'

#1


8  

Since they are the same structure then you can just do

因为它们是相同的结构,所以你可以做到


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

#2


15  

insert into tablea(id,name) select id,name from tableb;

#3


6  

leave out the values keyword

省略值关键字

insert into tbl1 
select * from tbl2

#4


5  

insert into blacklist 
select * 
from newblacklist

for uploading any single number

用于上传任何单个号码

insert into blacklist 
select * 
from newblacklist 
where numbers ='123456'