sql 中怎么将A,B 2张表没有重复的数据 从A表插入B表中?

日期:2017-12-15 11:45:45 人气:1

sql 中怎么将A,B 2张表没有重复的数据 从A表插入B表中?

你指的是要去除重复数据还是本来就没有重复数据? 另外A,B两表的结构一样吗? 如果A,B两个表中没有重复数据且表结构一样可以直接insert into B select * from A 如果结构不一样可以insert into B(字段列表),select 字段列表 from A 如果A,B两表中有重复数据可以 insert into B(字段列表),select 字段列表 from A where not exists(select * from B where a.keycol1 = b
    A+
热门评论