how to delete duplicate rows from a specified table(only
single table)
how do you know which join is need to be used

Answer Posted / jas

delete from table_name where rowid > (select min(rowid)
from table_name where a.col_name=b.col_name)

create new_table as select distinct * from table_name;
drop table_name;
create table_name as select * from new_table;
drop new_table;

delete from table_name where rowid not in (select max
(rowid) from table_name where a.col_name=b.col_name)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is nvl?

839


Hi how to import oracle sequence in Informatica? Please write stored procedure code that will import oracle sequence in Informatica SP transformation as per below scenario Oracle table product list Pro_id, pro_name 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights Now a new flat file with new product list needs to be added to oracle table product list with oracle sequence. flat file product Prono,pro_name, 1, 20 watt tube light 2, 30 watt tube light & target should be like 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights. 104, 20 watt tube light 105, 30 watt tube light thks reg suvarna joshi suvarnaatsuvarna@rediffmail.com

2295


Where the sql database files are stored?

742


Differentiate pl/sql and sql?

791


How run sql*plus commands that are stored in a local file?

761


What are the two types of cursors in pl sql?

783


Explain the the delete statements in sql?

802


Can you call pl/sql package functions from within a fast formula?

810


Define sql delete statement.

803


What is recursive stored procedure?

861


What is a recursive stored procedure?

880


How can you view the errors encountered in a trigger?

777


How many types of cursors are available in pl/sql?

819


What is normalization sql?

775


How many sql are there?

767