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

List the various types of value set.

627


testing tools?

1756


How to retry multiple errored workflow processes? What is the access level in workflow used for? How do you define start and end functions in workflow? How does they differ from normal functions? Give me some workflow tables? What is the difference between a function and notification in workflow? I have sent two different notifications to two different users and I want to wait till both they are approved to send 3rd notification. How can you achieve it? What is item type and item key in workflow? How do you use attribute values in workflow messages? How do you use lookups in workflow? What are roles in workflow and how they are used? How do you download or upload a workflow from a server? What are steps to customize the workflow? What functions can you perform from workflow administrator responsibility? To send an email to the user workflow notification is the only way or is there any other ways to send it? Give me some workflow standard procedures? How can you run/start/kickoff workflow? What is wf_engine package used for? How many processes can each workflow contain? What is Runnable option in workflow? At what level it exists? What are different types of attributes in workflow? How do you reassign a notification? What is process in workflow? How can you send direct oracle form link through workflow notifications? How can you send a notification to multiple users? Can you change the list dynamically? Can you send html code in workflow notification? I have sent two different notifications to two different users and I want to wait till atleast one is approved to send 3rd notification. How can you achieve it?

4314


how can i print random rows in plsql table

1943


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

1788






Plz anybody send me Technical specification for AP Interface

2017


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

1519


What are the benefits of using soa architecture?

711


what is global tempory table?

6313


What is sca and how is it useful?

663


pls send me out bound code of supplers,site,bankiformation code pls as soon as

1762


What is count(*) from po_vendors(any table)?

645


How can we import the data into a database using sql * loader?

682


Explain what are the tables of auto invoice?

650


What do you understand by soa and what are the benefits of using this architecture?

619