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 / eashwar v

IN SQL SERVER 2005, This can be easily achieved without
crating unique identifier by using CTE and ROW_NUMBER (),
the modified query for sql server 2005 goes here
***********************************************
WITH T1 AS (SELECT ROW_NUMBER ( ) OVER ( PARTITION BY ID,
FNAME, LNAME ORDER BY ID ) AS RNUM FROM DUPLICATE )
DELETE FROM T1 WHERE RNUM > 1
***********************************************
To get a detail grasp on ROW_NUMBER () OVER () … Refer MSDN
http://msdn2.microsoft.com/en-us/library/ms186734.aspx for.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to apply filtering criteria at group level with the having clause in ms sql server?

991


What are the properties of the transaction?

996


How to use go command in "sqlcmd"?

1194


Explain an automatic checkpoint

965


Explain insert into select statement?

939


What are the advantages of user defined function?

976


What are sub reports?

201


When we should use @@error?

958


What are the fixed server level roles? : sql server security

1116


How to generate create view script on an existing view?

976


How many types of triggers are there?

1054


What do you mean by cardinality?

897


Due to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

1317


How to use order by with union operators in ms sql server?

1013


What are the benefits and tasks of object explorer? : sql server management studio

1169