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

Answer Posted / dinesh kumar

delete from emp where id Not in(select max(id) id from emp
group by name having count(id)>1)

Is This Answer Correct ?    22 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is temporal table?

472


You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?

88


Name the different type of indexes in sql?

523


How do I open a .db file?

476


How many databases Microsoft SQL server provides?

600






What is table valued function and scalar valued functions?

487


What is bcp? When does it used?

543


What is a livelock?

549


What is the difference between insensitive and scroll cursor?

574


What is row_number function?

582


Explain what are the database objects? : SQL Server Architecture

556


How do you use a subquery to find records that exist in one table and do not exist in another?

540


Can a trigger be created on a view?

564


Why transaction is important?

557


What is public role in sql server?

528