【发布时间】:2016-11-30 03:30:17
【问题描述】:
【问题讨论】:
标签: sql db2 delete-row
【问题讨论】:
标签: sql db2 delete-row
delete from table1 f0
where rrn(f0) in
(
select f3.rw from (
select rrn(f1) rw,
rownumber() over(partition by Policy) rang
from table1 f1 inner join table2 f2 on f1.policy=f2.policy
) f3
where f3.rang=1
)
【讨论】:
delete top(select count(a.Policy)-1 From Table1 x where x.policy in (Select distinct policy from table2)) From Table1
【讨论】: