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 |
Describe different types of general function used in sql?
How do you delete duplicates in sql query using rowid?
What is secondary key?
what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba
What is the difference between mdf and ndf files?
What is the different between Stored Procedure and Procedure?
How is data stored on a disk?
What is on delete restrict?
Is sql workbench free?
What are user defined functions?
Is it possible to update views?
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...