Is it possible to delete duplicate rows in a table without
using a temporary table ?
Answer Posted / kalyan.k
yes,it is possible.
By using row_number function.
dept table contains two columns(eid,ename)
eid dname
1 k
1 j
1 u
2 k
2 j
2 u
with [dept ordered by eid] as
(
select row_number()over(partition by ei order by eid)as
rowid,* from dept
)
delete from [dept ordered by eid] where rowid >1
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Explain foreign key in sql server?
What is the New in SQL server 2008?
Does sql server 2000 clustering support load balancing?
How can I track the changes or identify the latest insert-update-delete from a table?
What stored procedure would you use to view lock information?
Mention the differences between sql server and mysql.
Do you know what is normalization of database? What are its benefits?
What is store procedure? When do you use?
What is nested transaction?
What does man by sql wildcard characters in sql server?
Explain database normalization?
Ms sql server index?
Do you know what is difference between index seek vs. Index scan?
What is a view in sql?
how can you select rexcord(rows) from table A which is not present in Table B . Id being the FK in Table B referencing to ID Table A