I have a table EMP in which the values will be like this
EmpId Ename Sal DeptId
11 Ram 10000 10
11 Ram 10000 10
22 Raj 20000 20
22 Raj 20000 20
33 Anil 15000 30
33 Anil 15000 30
I want to delete only duplicate Rows. After Delete I want
the output like this
EmpId Ename Sal DeptId
11 Ram 10000 10
22 Raj 20000 20
33 Anil 15000 30
Answer Posted / vikas kant
select Distinct * into #Temp_Temp1 from Emp
truncate table Emp
insert into Emp select * from #Temp_Temp1
select * from Emp
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do I setup a sql server database?
What stored by the model? : sql server database administration
List out the different types of locks available in sql server?
How will you add a dimension to cube? : sql server analysis services, ssas
What is an inner join?
What is dirty page?
Difference between DELETE and TRUNCATE?
What are the underflow and overflow behaviors on float literals?
New concepts of sql server 2005 use in your project.
What stored by the tempdb ? : sql server database administration
What is rank function?
What do you mean by collation recursive stored procedure?
Explain syntax for viewing trigger?
what changed between the previous version of sql server and the current version? : Sql server database administration
Give me any three differences between Truncate and Delete.