'============In Access it requires 4 steps =========================================
If I have to remove Duplicate records from Table1
Table1 with column Names(let say Name and Age)
Needs a Temp Table Table2 with same No. columns, different Names( let say Name1,Age1)
1: Clear Temp Table
2: Find First Records of duplicate records and insert these into temp Table2Code:Delete * from Table2
3: Delete all duplicate Records from Main Table Table1Code:Insert into Table2 Select First(Name) as Name1, First(Age) as Age1 FROM Table1 GROUP BY Name HAVING Count(Name)>1
4: Insert all Records of Temp Table into Main TableCode:Delete * from Table1 where Name in (Select First(Name) as Name1 FROM Table1 GROUP BY Name HAVING Count(Name)>1)
If anyone has better way to delete please post your answer.Code:Insert into Table1 select Name1 as Name,age1 as Age from Table2
Thanks
Rahul




Reply With Quote

Bookmarks