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...

Delete duplicate rows from a table without primary key by
using a single query
Table Employee
empname salary
A 200
B 300
A 200
C 400
D 500
D 500

Output should be

A 200
B 300
C 400
D 500

Answer Posted / gaurav sharma

SELECT DISTINCT * INTO Employee1 FROM Employee
DROP Table Employee
sp_rename 'Employee1','Employee'

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain having clause?

925


What are the system database in sql server 2008?

998


What is instead of dml trigger?

963


What is raid and what are different types of raid levels?

1102


Hi all, can any one please tell me the difference between sql server 2008 and orace 9i

1917


What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?

4322


Can we shrink data file in sql server?

1011


Tell me what is the order in which the sql query is executed?

917


what is denormalization? : Sql server database administration

892


What is the boxing and unboxing concept in .net?

883


How to generate random numbers with the rand() function in ms sql server?

1079


Explain the types of indexes.

1143


Are semicolons required at the end of sql statements in sql server 2005?

949


Can you explain what are the restrictions applicable while creating views? : SQL Server Architecture

869


What is used to replicate sessions between instances in coldfusion clusters?

1030