Like, I want to Delete one row containing 234 and keep another row only, and so on.
**Note: I am using IBM DB2 as database.
Like, I want to Delete one row containing 234 and keep another row only, and so on.
**Note: I am using IBM DB2 as database.
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