Write an SQL Query to
Delete Duplicate records from a table using ROWID.

Answer Posted / parthasarathi

delete T1
from MyTable T1, MyTable T2
where T1.dupField = T2.dupField
and T1.uniqueField > T2.uniqueField ;


Try this will work for SQL Server and My Sql but not for
MSAccess .....

For MSAccess try the below one

delete from MyTable
where uniqueField not in
(select min(uniqueField) from MyTable T2
where T2.dupField=MyTable.dupField);

The above query also works for SqlServer but not for MySql..

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are do's and dont's of Interface?

1896


What is sca and how is it useful?

649


what is the difference between request group and request security in oracle apps?

5034


In oracle application how do you debug or trace errors?

623


List the types of flexfield?

596






can we use look up type instead of a pofile option?or valueset?is it possible how?

1777


How to create a purchase order without a requisition?

615


List of all the modules under Manufacturing, Finance and Distribution in oracle applications?

1793


what is global tempory table?

6277


How can you achieve loose coupling in soa framework?

712


is it possible to run the interface without using oracle apps?

1512


What is instead of trigger in where we will use?

667


What is oracle soa suite?

755


can we get profile values in report without using user exists is it possible how?

2310


what are the balancing segments in AR?

1642