2009-12-23 64 views

回答

3

您可以複製行,然後僅刪除已複製的那些行:

delete A 
from A 
inner join B on A.key = B.key 

替代語法:

insert into B (keycol, col1, col2) 
select keycol, col1, col2 from A 

然後在那些已經B中刪除行

delete from A 
where exists (
    select * from B where A.key = B.key 
) 
+0

謝謝,當我坐在這臺電腦前太多常識似乎走出了窗口:) – Mickey 2009-12-23 22:18:15