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

What is user-defined functions? What are the types of user-defined functions that can be created?

1027


Explain features of analysis services?

983


What do you understand by the data quality services in sql server?

936


Which tcp/ip port does the sql server run on? How can it be changed?

1044


How is sql server used?

950


How do clustered indexes store data?

1089


What is set nocount on?

932


What do you mean by an execution plan? Why is it used? How would you view it?

920


How to use wildcard characters in like operations in ms sql server?

1123


Detail about query optimizer?

1089


which backup strategy you are following at ur company

2138


What is bit data type?

1019


Can we join two tables without primary key?

1034


What is BLOCK statements in SQL?

1257


Explain a join?

1056