Delete duplicate records from the table?(Table must have
unique id)

Answer Posted / krishna

select *
from mytable b
join
(
select Duplicatecolumn,MAX(id) id
from mytable
group by Duplicatecolumn
) b1 on b.Duplicatecolumn = b1.Duplicatecolumn
where b.id <> b1.id

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain microsoft sql server functions?

536


What are the differences between ms sql server & oracle?

513


Give an example of why you would want to denormalize a database

505


Data table as parameter in sql server?

556


i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.

1372






What are the acid properties?

549


What is cte (common table expression)?

591


Define msdb database?

590


What is coalesce and check constraint in sql server?

537


Why are sql functions used?

614


How does index makes search faster?

593


what are different types of backups available in sql server? : Sql server database administration

489


What authentication modes does sql server support?

590


What are the steps you will take to improve the performance of a poor performing query?

587


Explain filtered indexes benefits?

593