我有两个表,表的结构是相同的,现在我想把一个表中的内容写到另外一个表中,同时还要判断写入的那个表是否存在与当前写入的记录相同的记录,应该怎么实现?
谢谢
谢谢
解决方案 »
- 有关delphi中DBGridEh的使用
- 设置GroupBox的color属性为RGB值如何实现?
- 哪本书详细讲到FindFirst和FindNext查找文件???
- DBGirdEh如何显示access的备注类型
- 如何用类的成员函数做回调函数呀?
- 如何实现网络数据包监视、访问限制
- COM 中如何传结构体??
- radiogroup问题。
- 以前用VB,刚刚转入Delphi,不知道API函数在Delphi中如何声明使用,VB中光声明就要写一堆,Delphi呢?烦请举个例:GetComputerName
- 昨天在win2000下时碰到的一个问题,解决后放上来给大家以供参考
- dblookupcombobox中选择另外一项,会触发什么事件?
- 集合问题(简单)
table2:目標表insert into table2(field1,field2,......)
select field1,field2,......
from table2
where field1 not in (select distinct field1 from table1)
(select * from table2
where field1 not in (select distinct field1 from table1))
(select * from table2
where field1 not in (select distinct field1 from table1))
外星人 的就可以了 。UP
是oracle数据库,还是sqlserver数据库;insert /*+append */ into a select * from b;//平行插入,很快
然后检验是否有重复记录,用如下语句:
select 字段 from a group by 字段 having count(*)>1;
如果有重复的,删掉即可效率很高