Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is a rollup clause?

915


What is the beast way to write CTE in SQL Server ?

988


What is buffer cash and log cache in sql server?

1056


How to implement service broker?

925


What information is maintained within the msdb database?

928


What is SQL Azure Firewall?

134


Is profiler the only tool that has the ability to audit and identify ddl events? : sql server security

1015


What is the difference between a unique key and primary key?

899


How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?

1048


Does sql server use java?

999


Explain the microsoft sql server delete command?

954


How to get the definition of a trigger back?

962


What is named calculation? : sql server analysis services, ssas

934


We need to perform what steps in the following order to work with a cursor?

1171


what kind of lan types do you know? : Sql server database administration

928