Write a query to delete duplicate records in SQL SERVER

Answer Posted / sujit kumar suman,new delhi

DELETE DUPLICATE RECORDS FROM TABLE IN SQL SERVER:

DELETE FROM TABLE1
WHERE
ID NOT IN
(SELECT MAX(ID) FROM TABLE1
GROUP BY NAME)

WHERE ID IS IDENTITY FIELD AND NAME IS DUPLICATE FIELD

TRY THIS QUERRY AND ENJOY.......

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why use “in” clause in sql server?

635


What are the functions in sql server?

614


What is isnull() operator?

676


What are the advantages of using a stored procedure?

631


explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?

2082






Find columns used in stored procedure?

609


What is shrink log file?

581


Explain logical operators in sql server?

658


what is the main function of a query parameter?

115


How to write a query with a full outer join in ms sql server?

641


what are the critical issues you have resloved in your company

1629


Is truncate autocommit?

632


What happens if we shrink log file in sql server?

598


How to call a function from a stored procedure in SQL Server ?

641


What is the default schema of your login session in ms sql server?

669