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 / b.v.rajaram

delete top (select count(*)-(select count(distinct empname )
from Employee) from Employee)from Employee
where a in (select distinct a from Employee)

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the benefit of normalization?

1018


Do you know what are various aggregate functions that are available?

1013


What are the properties of the relational tables?

828


How to check status of stored procedure in sql server?

909


How can i Relate Tables in SSIS

1032


What is ssl in sql server?

1010


List the types of recovery model available in sql server?

867


How to get all stored procedures in sql server?

936


what do you understand by change data capture?

934


whats the maximum size of view state??

2146


Do you know what are the differences between lost updates and uncommitted dependencies?

1007


Is it possible to call a stored procedure within a stored procedure?

911


What are the advantages of mirroring?

934


What is the importance of concurrency control?

1175


Define the one-to-one relationship while designing tables.

855