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
What is user-defined functions? What are the types of user-defined functions that can be created?
Explain features of analysis services?
What do you understand by the data quality services in sql server?
Which tcp/ip port does the sql server run on? How can it be changed?
How is sql server used?
How do clustered indexes store data?
What is set nocount on?
What do you mean by an execution plan? Why is it used? How would you view it?
How to use wildcard characters in like operations in ms sql server?
Detail about query optimizer?
which backup strategy you are following at ur company
What is bit data type?
Can we join two tables without primary key?
What is BLOCK statements in SQL?
Explain a join?