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

Answer Posted / amit bhatnagar

Swati is cool. buth her queries are correct. you can either
take rowid >with subquery fetching minimum (rowid) else
Rowid < with subquery fething maximum (row id)

DELETE FROM <table_name> T1
WHERE T1.ROWID > (SELECT MIN(T2.ROWID)
FROM <table_name> T2
WHERE T2.<common column name> = T1.<common
column name>)

----------------------------

DELETE FROM <table_name> T1
WHERE T1.ROWID < (SELECT MAX(T2.ROWID)
FROM <table_name> T2
WHERE T2.<common column name> = T1.<common
column name>)
Good job Swati.. :)

Is This Answer Correct ?    15 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which oracle applications pl/sql standard apis you are familiar, have you used most of them?

624


Can you differentiate between mediator and osb?

618


please any one provide the oracle erp technical interview questions on modules(PO,AP,AR,INV,GL,OM)wise to my mail id..narendra_609@yahoo.co.in

3062


Tell me how to find the custom directory in front end?

650


what are the prerequisites for costing transactions?

2624






what is the differences between internal requisition and internal sales order?

2145


What is instead of trigger in where we will use?

667


Can we create tables in apps schema?

606


How to create a purchase order without a requisition?

613


Is soa a part of oracle fusion middleware?

599


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

634


What do you understand by soa?

680


List the types of flexfield?

594


How to move the one file from one instance to another instance? And your scripts also?

603


Suppose for report I have to parameters those are from_date and to_date, so to_date should be greater when compare to from_date, if we are giving to_date is lessthen it must shows some error how we will make?

619