write a query to remove duplicate records without using primary key column?

Answers were Sorted based on User's Feedback



write a query to remove duplicate records without using primary key column?..

Answer / 312

351

Is This Answer Correct ?    3 Yes 3 No

write a query to remove duplicate records without using primary key column?..

Answer / mathanrathinam


delete tmp from(select col1,col2,row_number over(partition by col1,col2 order by col1,col2) rownum from tablename) tmp
where rownum >1

Is This Answer Correct ?    7 Yes 8 No

Post New Answer

More SQL Server Interview Questions

What are the differences between local and global temporary tables?

0 Answers  


How do I create a stored procedure in dbml?

0 Answers  


Define master database?

0 Answers  


How each E-R model constructs can be mapped to the relational model?

0 Answers   HCL,


How to create hyperlink from returned sql query ?

0 Answers   MCN Solutions,


What is deadlock and how to avoid the deadlocks.

3 Answers   TCS, Wipro,


How to enter unicode character string literals in ms sql server?

0 Answers  


Is INSTEAD OF trigger directly applicable to Table ?

0 Answers  


What is temporal table?

0 Answers  


How you can change the database name in SQL SERVER?

0 Answers  


what is the difference between delete,drop and truncate

2 Answers   Honeywell, Zomato,


What is the difference between count () and rowcount ()?

0 Answers  


Categories