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

Why I am getting this error when renaming a database in ms sql server?

988


Explain the difference between cross join and full outer join?

924


How to manipulate data from one table to another table ?

911


What is the process of indexing?

942


What do you understand by SQL*Net?

957


How many databases instances are there in sql server 2000?

1023


What are the new features in sql server 2016?

929


What is left outer join in sql server joins?

969


Please illustrate physical database architecture? : SQL Server Architecture

937


tell me what are the steps you will take to improve performance of a poor performing query? : Sql server database administration

963


How can we rewrite sub-queries into simple select statements or with joins?

921


Find nth lowest salary or get nth lowest salary?

965


Give an example of SQL injection attack ?

929


What is the difference between varchar and varchar(max) datatypes?

1002


What is an example of a primary key?

912