There is a big table with "n" of rows and 40 + columns .It
doesn't have primary key.How do you select the primary key.
In other words how do you get the duplicate records.

Answer Posted / harikanth

Suppose Table name is Dup_Del with id as a column(consists
10,20,30,10,10,30,20)then

select * from Dup_Del
where rowid not in(select * from
(select min(rowid) from Dup_Del
group by id
);
the above query will give you the duplicate records. if you
want unique records then

select * from Dup_Del
where rowid in(select * from
(select min(rowid) from Dup_Del
group by id
);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.

1811


What is an oracle table?

729


Explain the use of record length option in exp command.

780


What is sequence?

807


Oracle

2108






How to export data with a field delimiter?

761


How to pass a parameter to a cursor in oracle?

811


What is the difference between $oracle_base and $oracle_home?

777


What is connection pool in oracle?

718


Explain the use of grant option in imp command.

729


State the difference along with examples between Oracle 9i, Oracle 10g and Oracle 11i.

784


How to define and use table alias names in oracle?

696


What is redo log?

783


How to drop an existing table in oracle?

789


Explain the use of online redo log files in oracle.

760