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 delete duplicate rows from table in sql server

Answer Posted / smitha

;with empctc(empid,ename,sal,deptid,ranking)
as
(Select empid,ename,sal,deptid,ranking=Dense_rank() over (
partition by empid,ename,sal,deptid order by NEWID() asc)
from emp
)
delete * from empctc where ranking>1

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention the different types of replication in sql server.

1006


What are the indexes in sql server?

1094


What is SQL Azure Fabric?

110


IF more than one Site is accessing the same Database server and I want to move the DB with Minimum down time? How will you do

1789


tell me the disaster recovery plan

2497


What is usually the first word in a sql query?

1106


What method is used by the Command classes to execute SQL statements that return single values?

1044


what are the critical issues you have resloved in your company

1947


how many no of arguments can be passed in procedures and functions

5527


Can I work with several databases simultaneously? : sql server management studio

968


What are cursors and when they are useful?

1070


How to check parameter value in stored procedure sql server?

958


Detail about the hardware which is supported by SQL server?

1045


What is a unique key constraint?

1006


what is memory-optimized nonclustered indexes

1000