Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



how to delete duplicate rows from a specified table(only single table) how do you know which join..

Answer / mkumar.it

delete <table_name> where rowid not in (select min(rowid)
from <table_name> group by <dup_rec_col>)

max(rowid) can also be used provided you have to retain the
latest value other wise min(rowid) is fine.

Is This Answer Correct ?    8 Yes 0 No

how to delete duplicate rows from a specified table(only single table) how do you know which join..

Answer / dinesh mohan upadhyay

delete from emp
where rowid>any(select min(rowid) from emp a where
a.col1=col1)

Is This Answer Correct ?    15 Yes 8 No

how to delete duplicate rows from a specified table(only single table) how do you know which join..

Answer / samir kumar sahoo.

DELETE FROM tablename A WHERE ROWID>(SELECT MIN(ROWID) FROM
tablename B WHERE A.key_values=B.key_values);

Is This Answer Correct ?    6 Yes 2 No

how to delete duplicate rows from a specified table(only single table) how do you know which join..

Answer / lakshya

SELECT * FROM table_name
WHERE ROWID NOT IN (SELECT MIN(ROWID) FROM table_name GROUP
BY table_columns);

Is This Answer Correct ?    9 Yes 8 No

how to delete duplicate rows from a specified table(only single table) how do you know which join..

Answer / raghavendraprasad

delete from table_name where rowid not in (select max
(rowid) from table group by duplicate_values_field_name);

Is This Answer Correct ?    2 Yes 1 No

how to delete duplicate rows from a specified table(only single table) how do you know which join..

Answer / 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

how to delete duplicate rows from a specified table(only single table) how do you know which join..

Answer / venkateswararao

delete from emp p where rowid<(select max(rowid) from emps where p.ename=s.ename)

Is This Answer Correct ?    1 Yes 0 No

how to delete duplicate rows from a specified table(only single table) how do you know which join..

Answer / kishor solanki @ 9904762204

CREATE TABLE new_table as SELECT * FROM test GROUP BY url;
DROP TABLE test;
RENAME TABLE new_table TO test;

Is This Answer Correct ?    1 Yes 0 No

how to delete duplicate rows from a specified table(only single table) how do you know which join..

Answer / arif jameel

First add an Identity Column in table

Alter table <tblname>
Add < New_columnID > int identity(1,1)

Delete from <tblname> where < New_columnID> in
(select max(New_columnID)from <tblname>
Group by <tbl_columnname>
having count (<tbl_columnname>)>1)

Is This Answer Correct ?    1 Yes 1 No

how to delete duplicate rows from a specified table(only single table) how do you know which join..

Answer / kishor solanki @ 9904762204

create table newtable as select * from oldtable order by dupcol;
drop oldtable;
rename newtable to oldtable;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

what are the forced views

6 Answers   Hexaware, TCS,


how can create data base link for tow servers (scott schema) give examples plz

2 Answers  


While inserting 10 rows using procedure, if 3rd entry is having some error, what will be the output? How u will handle that error?

8 Answers   iFlex,


How much does sqlite cost?

0 Answers  


How do you assign Construct the where clause without concatenating Field,value pairs?

1 Answers   Microsoft,


I m giving Source, Destination and Age. Write a procedure or function, it will give to u this source to destination tickets are available or not, if available then check this person is senior citizen or not,if this person is senior citizen then give some discount. PLZ give this answer...... Thanks advance.....

3 Answers  


What is anonymous block in sql?

0 Answers  


What is asqueryable?

0 Answers  


what is sql optimization

1 Answers   Fidelity,


what is schema? : Sql dba

0 Answers  


How can multiply values of a column? OR How can multiply value of a row of a column using a single query in SQL?

1 Answers   Pitney Bowes,


What steps server process has to take to execute an update statement?

0 Answers  


Categories