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

Write a program using SQL queries to find a unique entry in a table.

995


What are the different types of triggers in SQL SERVER?

1139


How to create a trigger for insert only?

1041


How to skip remaining statements in a loop block using continue statements?

998


wat wil hapn if we give the both read and deny read permission to user?

2103


What are the general features of sql server management studio? : sql server management studio

1077


What is it unwise to create wide clustered index keys?

1007


What are the 10 characteristics of data quality?

956


How to drop an existing table?

1007


Can we return Data from 4(more than 1) tables in stored procedure?

1059


How to search for a string in all stored procedure in sql server?

999


What is dimension table? : sql server analysis services, ssas

1020


What are the functions in sql server?

948


What is instead of dml trigger?

1004


Which event (check constraints, foreign key, rule, trigger, primary key check) will be performed last for an integrity check?

1007