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...

How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?

Answer Posted / lince thomas

it is very simple,,below
------------------------
select * from(
select row_number() over(partition by empname order by
empname)as rno,empname,salary from Emp1Pay)T
where T.rno>1


delete from Emp1Pay where empid=
(select empid from(select row_number() over(partition by
empname order by empname)as rno,empid
from Emp1Pay )T where T.rno>1)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are there any preferred steps that need to be taken care of before starting the installation of sql server 2000?

940


what is the different types of backups available in sql server? : Sql server database administration

879


How can we delete Duplicate row in table?

998


What is the report model project?

130


Why do we use functions?

852


How you can get a list of all the table constraints in a database?

906


What is log in sql server?

1075


What options are there to delete rows on the publisher and not on the subscriber? : sql server replication

1145


Can we use where and having clause together?

977


what are different types of raid configurations? : Sql server database administration

993


How do you manipulate data?

848


What is the use of @@spid?

955


What is a bit datatype?

921


How to delete an existing row with delete statements in ms sql server?

1017


can any body tell me how to know the password of current user in sql server

2022