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

What do you understand by a set of books?

843


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

3347


What are the different components you should consider while defining a responsibility in oracle apps?

852


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

903


Which oracle apps version you are very confident in?

948


Are you familiar with internet architecture of oracle apps 11i?

835


How do you register report in oracle apps?

876


What is the concept of soa governance?

1001


what is global tempory table?

6760


Do you know what are user profiles in apps. Any examples you can give?

878


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

884


In hierarchical structure of a database? we have write query from where we should start?

1936


List the various types of value set.

825


What does appl_top directory contain?

861


how can i print random rows in plsql table

2153