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

Write a program using SQL queries to find a unique entry in a table.

1039


Explain the working of sql privileges?

1141


What is the maximum size per database for sql server express?

1097


What the class forname () does?

1132


Explain the different types of joins?

1042


How is a full-text index updated?

998


How to install sql server 2005 express edition?

1166


What is stored in the mssqlsystemresource database? : sql server database administration

1075


what are constraints? Explain different types of constraints? : Sql server database administration

1041


Which are the new data types introduced in sql server 2008?

922


Explain Reporting Life Cycle?

132


How can we use ConnectorJ JDBC Driver with MS SQL?

1050


Explain difference between control flow and data flow?

1011


what is new philosophy for database devises for sql server 7.0? : Sql server database administration

1047


How can we get count of the number of records in a table?

989