将一个表的查询结果插入到另一个表中

  

#如果表存在:
insert into tab1 select * from tab2;
#只导一个字段:
insert into tab1(id) select id from tab2 where catid=522;

#如果表不存在:
create table tab1 as select * from tab2; 
 

猜你喜欢

转载自wyqjx.iteye.com/blog/2061688