1

私は2つの異なるデータベースから重複レコードを特定することができます。

select * from 
    taskperformance a,  taskperformance@dm_prod b
where 
    a.activityin = b.activityin
    and a.completiondate = b.completiondate

重複したレコードをから削除するにはどうすればよいbですか?

私は試した:

delete taskperformance@dm_prod  where exist ( 
select * from 
    taskperformance a,  taskperformance@dm_prod b
where 
    a.activityin = b.activityin
    and a.completiondate = b.completiondate ) 

しかし、それは私が必要とする以上のものを削除します。

4

1 に答える 1

2

bサブクエリで再参照しないでください。

delete taskperformance@dm_prod b
where exists (
    select * from taskperformance a
    where a.activityin = b.activityin 
    and a.completiondate = b.completiondate 
)
于 2009-08-27T01:25:02.543 に答える