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 to create an identity column?
What is an execution plan?
what is raid? : Sql server database administration
Find first and last day of current month in sql server
What is a derived table?
Why do we need normalization?
What is subreport?
How you can get the list of largest tables in a database?
Where are sql server user names and passwords stored in sql server?
How to return the top 5 rows from a select query in ms sql server?
What is efficiency data?
What are the advantages of stored procedure in sql server?
as a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this? : Sql server administration
How to change server name in sql server?
What is a rollup clause?