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
What is a rollup clause?
What is the beast way to write CTE in SQL Server ?
What is buffer cash and log cache in sql server?
How to implement service broker?
What information is maintained within the msdb database?
What is SQL Azure Firewall?
Is profiler the only tool that has the ability to audit and identify ddl events? : sql server security
What is the difference between a unique key and primary key?
How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?
Does sql server use java?
Explain the microsoft sql server delete command?
How to get the definition of a trigger back?
What is named calculation? : sql server analysis services, ssas
We need to perform what steps in the following order to work with a cursor?
what kind of lan types do you know? : Sql server database administration