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

Write a program to fetch first 10 records from a file?

967


What do you know about system database? : SQL Server Architecture

929


After removing a table from database, what other related objects have to be dropped explicitly?

998


Can we deploy SSRS reports on our personal website?

162


How ssrs maintain security?

1016


Can we use where clause in union?

1001


How many levels of sp nesting is possible?

996


Where are sql server usernames and passwords stored in the sql server?

1042


what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?

1908


What is dbcc? Give few examples.

952


What is the maximum length of an alert name?

959


What is normalization? Describe its different types.

1040


To which devices can a backup be created and where should these devices be located? : sql server management studio

968


How to provide default values to function parameters?

1051


How we can refresh the view?

1056