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 records from a table?(for suppose in
a table we have 1000 Records in that we have 200 duplicate
Records , so ,how to findout that duplicate Records , how to
delete those Records and arranged into sequence order? one
more thing that there is no primary key at all)

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 ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does top operator do?

1028


What guidelines should be followed to help minimize deadlocks?

948


How to enter comments in transact-sql statements?

951


What are the steps to follow to configure SQL*Net?

1046


What happens if date-only values are provided as date and time literals?

1027


Explain different backup plans?

952


What is the preferred way to create a clustered and non-clustered index? Which index should you create first the clustered or non-clustered?

915


Explain the steps needed to create a scheduled job?

939


How will you monitor replication activity and performance? What privilege do you need to use replication monitor? : sql server replication

1082


What are the advantages of user-defined functions over stored procedures in sql server?

1049


Can we write a distributed query and get some data which is located on other server and oracle database?

1235


What is ssl in sql server?

1083


What is the current limitation of the size of SQL Azure DB?

127


How much memory that we are using in Logshipping Concept?

1800


Explain what is “asynchronous” communication in sql server service broker?

924