开发者

Database - Query

开发者 https://www.devze.com 2023-01-21 06:09 出处:网络
I have two Database (eg. two .mdb file). both have same name, same table and same field. the difference is one is old and other is updated copy of .mdb file.

I have two Database (eg. two .mdb file). both have same name, same table and same field. the difference is one is old and other is updated copy of .mdb file. i want to copy only new records from the updated copy of the .md开发者_运维知识库b to the older one. is there any way other than iterate trough all the records and compare and filter only newer one?


select * 
from A 
where (col1,col2,…) not in 
(select col1,col2,… from B) 
union all 
select * from B 
where (col1,col2,…) not in 
(select col1,col2,… from A); 

Edit: sorry, you only need to do this one way.

 select * from B 
where (col1,col2,…) not in 
(select col1,col2,… from A); 
0

精彩评论

暂无评论...
验证码 换一张
取 消