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

Relational calculus is what type of language?

1049


Do you know what are the steps to process a single select statement?

987


Why we need sql server?

975


In what version of sql server were synonyms released?

950


what are database files and filegroups? : Sql server database administration

954


It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio

1054


What do you mean by stored techniques? How would we use it?

1044


How can change procedure in sql server?

1076


What is data source in connection string?

917


Do you know what is replace and stuff function in sql server?

1028


What is trigger explain with program?

993


What is the difference between nvl and nvl2?

988


What is wide table?

957


What is buffer cash and log cache in sql server?

1133


How do I install sql server?

901