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

Name three sql operations that perform a sort.

0 Answers  


what is explain plan?, given an example...

3 Answers   Polaris,


What are system versioned tables?

0 Answers  


What is Materialized View? In What Scenario we Use Materialized View?

2 Answers   Dinesh, Marlabs,


Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql

0 Answers  


What does desc stand for?

0 Answers  


i want insert 10 records from table a to table b. if i m using statement level trigger how many record insert ?in row level trigger how many record inserted???

3 Answers   Scope International,


What is a parameter query?

0 Answers  


What is meant by cursor in sql?

0 Answers  


How to use distinct and count in sql query? Explain

0 Answers  


Is not equal in sql?

0 Answers  


How does sql*loader handles newline characters in a record? : aql loader

0 Answers  


Categories