Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

delete duplicate records ....

user591315Nov 12 2007 — edited Nov 12 2007
need to delete duplicate from the table.emp_id is the primary key...but duplicate records have been inserted in the table dur to bad logic.but to make it simple i can identify all records that have same demographic_id as duplicates.I need to delete all the duplicates and keep only those have been last updated(i mean record that have max(last_update).
the rows are as follows.the query should delete all the below record accept one with emp_id as 4 and 8 as the have max date in thier respective groups.
emp_id demog_id name last_update
1 23 ash 1/1/2006
2 23 ashu 1/5/2007
3 23 ashly 1/1/2004
4 23 ashyun 11/12/2007
5 87 jay 1/1/2005
6 87 jayesh 1/5/2002
7 87 jashy 1/1/2000
8 87 jai 11/12/2007
thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 10 2007
Added on Nov 12 2007
1 comment
292 views