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 different type of replication in sql server?

935


Explain the database you used in your final year project?

974


What is transaction server explicit transaction?

973


How to find tables without indexes?

1034


what is datawarehouse?

1058


What are the reporting services components?

130


How check triggers in sql server?

916


How do you set a trace flag in sql server?

998


Explain various data region available in ssrs with their use?

879


How we create SQL Server 2005 Reporting Services ? Give me Sample

1941


What are “lock” hints?

1002


Can a cursor be updated? If yes, how you can protect which columns are updated?

1039


How does using a separate hard drive for several database objects improves performance right away?

887


What is a filestream?

945


Differentiate between ms sql server reporting services vs crystal reports?

855