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

Explain about protocol layer present in SQL server?

1209


what is a live lock? : Sql server database administration

961


Why are sql functions used?

1124


Where is my database stored on the hard disk in ms sql server?

1063


What is bookmark link in ssrs?

244


which backup strategy you are following at ur company

2149


What is collation sensitivity? Explain different types.

1016


What is function of ROLLUP ?

1087


What are built in functions?

1026


How to verify a user name with sqlcmd tool?

1084


What are orphan records?

933


Explain log shipping?

1023


What is single-user mode and what are the steps you should follow to start sql server in single-user mode?

976


What is the recommended total size of your memory optimized tables?

967


How to delete duplicate rows in sql server?

1112