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 record from a particular table?

Answer Posted / jagan mohan varma

employee
----------------------------
eid ename sal
----- --------- ------
1 jagan 2000
2 mohan 3000
3 varma 4000
********************************
attendence
-------------------------------
id eid date
----------- ----------- -----------------------
10 1 2010-06-10 00:00:00.000
11 1 2010-06-10 00:00:00.000
12 2 2010-06-10 00:00:00.000
13 2 2010-06-10 00:00:00.000
14 3 2010-06-10 00:00:00.000
15 3 2010-06-10 00:00:00.000
16 3 2010-06-10 00:00:00.000
*************************************************

Deleting duplicate records from attendence table could be:
**********************************************************

delete from attandence
where id not in (
select max(atd.id)
from employee emp
inner join attandence atd
on atd.eid = emp.eid group by atd.eid)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the essential components of sql server service broker?

1065


what are the different stages of Report Processing?

141


What is a cube? : sql server analysis services, ssas

1054


What is log cache in sql server?

1097


Where do you find the default Index fill factor and how to change it?

1114


Tell me what are the advantages of using stored procedures?

1062


What are the advantages to use stored procedures?

1181


List the different types of collation sensitivities in sql server?

1078


What is a data collection table?

1051


Can we write trigger for view?

1071


What changes in the front end code is needed if mirroring is implemented for the high availability? : sql server database administration

1082


What are data files?

1094


Does order by actually change the order of the data in the tables or does it just change the output?

1204


What is database mirroring?

1175


can a table be moved to different filegroup? : Sql server administration

1020