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 to convert numeric expression data types using the cast() function?
How do use Having,Group by,Group function in SQL?
What is transaction server explicit transaction?
How to create user defined functions with parameters?
What is the difference between ddl and dml?
What is the difference between char and varchar2 datatype in sql?
Explain the difference between primary keys and foreign keys?
What is your recommendation for a query running very slow? : sql server database administration
How to encrypt Strored Procedure in SQL SERVER?
How to install sql server 2005 express edition?
How to list all schemas in a database?
What is a view in sql?
Explain filestream storage of sql server 2008?
What is log ldf?
What is temporal data type?