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
How you can find out if an index is useful to the optimizer?
Explain candidate key, alternate key, and composite key?
What is faster join or union?
Explain in details security in SQL azure?
How to create an index on an existing table in ms sql server?
How is a full-text index updated?
What is format parameter in ssrs?
how to avoid cursors? : Sql server database administration
Why normalization is used?
Can you leave a union at any time?
What is the use of keyword with encryption.
Tell me the use of keyword with encryption. Create a store procedure with encryption?
What is raid and what are different types of raid levels?
What the class forname () does?
What are the properties of the transactions?