how to delete duplicate rows from a specified table(only
single table)
how do you know which join is need to be used

Answer Posted / arif jameel

First add an Identity Column in table

Alter table <tblname>
Add < New_columnID > int identity(1,1)

Delete from <tblname> where < New_columnID> in
(select max(New_columnID)from <tblname>
Group by <tbl_columnname>
having count (<tbl_columnname>)>1)

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain architecture of sql server notification services?

810


what is collation? : Sql dba

839


What is the importance of sqlcode and sqlerrm?

1092


What is trigger explain it?

780


What is a database trigger?

826


what are all different types of collation sensitivity? : Sql dba

747


What is the main reason behind using an index?

766


What is self-join and what is the requirement of self-join?

895


how to drop an existing view in mysql? : Sql dba

828


What is the file extension for sql database?

709


what is the difference between truncate and delete statement? : Transact sql

817


how can we destroy the session, how can we unset the variable of a session? : Sql dba

759


what is a field in a database ? : Sql dba

791


Can we create table in function?

755


Does a primary key have to be a number?

723