How to remove duplicate rows from a table?.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Name three sql operations that perform a sort.
what is explain plan?, given an example...
What are system versioned tables?
What is Materialized View? In What Scenario we Use Materialized View?
Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql
What does desc stand for?
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?
What is meant by cursor in sql?
How to use distinct and count in sql query? Explain
Is not equal in sql?
How does sql*loader handles newline characters in a record? : aql loader