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
Explain about protocol layer present in SQL server?
what is a live lock? : Sql server database administration
Why are sql functions used?
Where is my database stored on the hard disk in ms sql server?
What is bookmark link in ssrs?
which backup strategy you are following at ur company
What is collation sensitivity? Explain different types.
What is function of ROLLUP ?
What are built in functions?
How to verify a user name with sqlcmd tool?
What are orphan records?
Explain log shipping?
What is single-user mode and what are the steps you should follow to start sql server in single-user mode?
What is the recommended total size of your memory optimized tables?
How to delete duplicate rows in sql server?