表数据追加插入SQL 有表A和表B的表结构完全一致,A,B中有部分数据相同,如何把A中的数据追加插入到B表中?即,如果A表中的数据x在B表存在,不插入,如果不存在则插入B表。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 trucate table binsert into bselect * fro a insert b select a.* from a left join b on a.key=b.key where b.key is null insert B select * from A where not exists(select 1 from B where a.x=b.x) insert into b select * from a --2005insert b select * from A except select * from b insert B select * from A where not exists(select 1 from B where a.x=b.x) insert b select * from a except select * from bexcept--是找出表A中有的表B中没有的数据 insert B select * from A where not exists(select 1 from B where A.主键字段1=B.主键字段1 and A.主键字段2 = B.主键字段2 and.....) 模糊查询的问题 数据库 sql server 2K5 日志传送失败是不是会导致log文件无限制增长?? 数据量太大了,如何保存?用触发器解析数据包,处理的过来吗? 最近数据库老是死锁,系统老是写不进数据,或者很多用户,只有某部分用户才能输入,正在想,是不是程序中用了一些语句把某些表给锁死了呢? 字符串问题 请教一个求平均值得查询? 当ORACLE8.1.7中的某一表的数据有改动时,怎样将这个表的数据时时反映到SQL SERVER 2000的某一表中? 数据库 vfp->sql server? 表的关联 为表中字段 增加注释 自增ID重新排序
insert into b
select * fro a
insert b select * from A except select * from b
insert b select * from a except select * from bexcept--是找出表A中有的表B中没有的数据