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...

Is it possible to delete duplicate rows in a table without
using a temporary table ?

Answer Posted / kalyan.k

yes,it is possible.

By using row_number function.

dept table contains two columns(eid,ename)

eid dname

1 k
1 j
1 u
2 k
2 j
2 u


with [dept ordered by eid] as
(
select row_number()over(partition by ei order by eid)as
rowid,* from dept
)
delete from [dept ordered by eid] where rowid >1

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to convert numeric expression data types using the cast() function?

1002


How do use Having,Group by,Group function in SQL?

1691


What is transaction server explicit transaction?

968


How to create user defined functions with parameters?

1162


What is the difference between ddl and dml?

1002


What is the difference between char and varchar2 datatype in sql?

1006


Explain the difference between primary keys and foreign keys?

943


What is your recommendation for a query running very slow? : sql server database administration

992


How to encrypt Strored Procedure in SQL SERVER?

1096


How to install sql server 2005 express edition?

1055


How to list all schemas in a database?

1003


What is a view in sql?

924


Explain filestream storage of sql server 2008?

948


What is log ldf?

930


What is temporal data type?

868