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

Delete duplicate records from the table?(Table must have
unique id)

Answer Posted / krishna

select *
from mytable b
join
(
select Duplicatecolumn,MAX(id) id
from mytable
group by Duplicatecolumn
) b1 on b.Duplicatecolumn = b1.Duplicatecolumn
where b.id <> b1.id

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between delete,drop and truncate in SQL Server?

1103


How will you go about resolving deadlocks?

971


What is the use of tempdb? What values does it hold?

1072


What are pessimistic lock and optimistic lock?

1079


What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions. From Enterprise Manager we can configure the logshipping. In logshipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and we can use this as the DR (disaster recovery) plan.

2762


what are triggers? : Sql server database administration

907


What is the maximum size of sql server database?

1011


What are the drawbacks of reporting in ssrs?

150


Can group functions be used in the order by clause in ms sql server?

1014


Mention the different types of replication in sql server.

1026


What does it mean if @@cursor_row returns a negative number?

993


What is difference between delete & truncate commands?

1083


what is the system function to get current user's user id? : Sql server database administration

1005


Explain about Joins?

993


How to create view in stored procedure sql server?

1018