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 / honey

with myCTE as(
select row_number() over( partition by empname order by
empname) as myCount from Employee
)delete from myCTE where myCount >1

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between uniqe index and uniqe constraint?

988


How to get a list all databases on the sql server?

1109


How to find the list of fixed hard drive and free space on server?

1207


what is the information that can be stored inside a bit column? : Sql server database administration

973


Explain stored procedure?

1060


Can an entity have two primary keys?

986


Why do you want to join software field as you have done your BE in Electronics?

2150


Can another user execute your local temporary stored procedures?

996


What function does a database engine serve in the sql server?

1044


Explain different types of lock modes in sql server 2000?

939


Explain different types of locks in sql server.

1086


What are translations and its use? : sql server analysis services, ssas

1050


What is the report builder?

141


What is the exact numeric data type in sql?

1007


What is the significance of null value and why should we avoid permitting null values?

996