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 acid mean in sql server?

1128


What do you do in data exploration

1000


how many type of indexing in database?

987


Explain about remote stored procedure?

1017


What is difference between index and primary key?

1105


How do you size a resultset?

922


New concepts of sql server 2005 use in your project.

2367


How to trouble shoot if unable to connect SQL Server

2001


How many categories of data types used by sql server?

1026


Explain boyce and codd normal form(bcnf)?

967


What is best institute to Learn DotNET And SQL in chennai?

2169


What are synonyms?

967


What is #table in sql server?

1052


Do you know concepts and capabilities of sql server?

1070


What is nonclustered index on computed columns?

966