How to remove duplicate rows from a table?.

Answers were Sorted based on User's Feedback



How to remove duplicate rows from a table?...

Answer / vamsi

for example our emp table have duplicate rows than we can
run this query to delete those duplicate rows

Delete from emp a
where rowid <> ( select max(rowid) from emp where empno =
a.empno);

Is This Answer Correct ?    13 Yes 4 No

How to remove duplicate rows from a table?...

Answer / lova raju allumalla

delete from emp where rowid not in (select min(rowid) from
emp group by empno);

Is This Answer Correct ?    7 Yes 2 No

How to remove duplicate rows from a table?...

Answer / karthik

with [dup_cte] as {
select row_number(partition by eid order by eid) as rn from emp}
go
delete from [dup_cte] where rn>1

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

Describe different types of general function used in sql?

0 Answers  


How do you delete duplicates in sql query using rowid?

0 Answers  


What is secondary key?

0 Answers  


what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba

0 Answers  


What is the difference between mdf and ndf files?

0 Answers  






What is the different between Stored Procedure and Procedure?

7 Answers   Informatica, MIS,


How is data stored on a disk?

0 Answers  


What is on delete restrict?

0 Answers  


Is sql workbench free?

0 Answers  


What are user defined functions?

0 Answers  


Is it possible to update views?

0 Answers  


take one table is t1 and in that column name is f1 f1 column values are 200 5000 3000 7000 300 600 100 400 800 400 i want display the values asc and desc in a single output. sample output is f1.a 100 200 300 400 500 600 etc...... and f1.d is 5000 4000 3000 2000 1000 etc...

9 Answers   Zensar,


Categories