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
Do you know what are pages and extents? : SQL Server Architecture
What is difference between sql and sql server?
Explain the difference between control flow and data flow?
Explain about link server in sql server?
How to install sql server 2005 express edition?
how to avoid cursors? : Sql server database administration
What are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?
What are the differences between having and where clause.
Which Model uses the SET concept
What does COMMIT command do?
What is difference between standardization and normalization?
What is raid? : SQL Server Architecture
Is sql server implemented as a service or an application? : Sql server database administration
What are the restrictions that views have to follow?
How to find the service pack installed? : sql server database administration