delete duplicate rows from joining tables
Table names A and B
Duplicated result set from A and B
select a.*,b.* from a,b
where a. id in (select b.id from b where id=8888 group by id having count(id) > 1)
The result as follows
a.id, a.name, b.id , b.name
001 Adam 002 Adam
002 Adam 002 Adam
003 frank 003 frank
004 frank 004 frank
I want to delete rows from table 'a' using the above result set/SQL ( there are about million duplicates)
something as follows
delete from a
where rowid > (select min(a.rowid)
where a. id in (select b.id from b where id=8888 group by id having count(id) > 1))