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 retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?

Answer Posted / gaurav jain

begin
select distinct * into #one from four where id in (select
id from four group by id
having count(*)>1)
delete from four where id in (select id from four group by
id having count(*)>1)
insert into four select * from #one
end

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is public role in sql server?

1215


What is unpivot?

1077


How to find out what is the default collation in a database?

1180


Why we use the openxml clause?

1057


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

984


What is right outer join in sql server joins?

1222


How to override dml statements with triggers?

1277


What does indexation mean?

1033


What security features are available for stored procedure?

1080


Difference between aggregate functions of sql?

1149


What are data resources?

965


Why use triggers?

1068


what are the different ways to return the rowcount of a table?

1055


What are the pre-defined functions in the sql server?

1186


Why we need to use secondry database file? though, we can do same work using primary database file also.

7010