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

List out different types of normalizations in sql server and explain each of them?

0 Answers  


1.can we set the more than 1 primary keys for a table? 2.please give me the difference between Cluster Index and non-Clustered Index 3.can we use query like this "Select * from Table1,Table2;"

8 Answers  


What are sql server procedures?

0 Answers  


What are sp_configure commands and set commands?

0 Answers  


What is molap and its advantage? : sql server analysis services, ssas

0 Answers  






How to read 2nd highest sal from EMP table?

5 Answers   IBM, TCS,


What is meant by dirty read?

0 Answers  


Is index a datbase objects in sql server?

2 Answers  


What is the purpose of forms?

0 Answers  


my problem is tempdb tempdb(dbname) 77752.95 MB(db size) 25345.03 MB (unallocated size) suppose i increased temp db size 10 gb . after increase the temp db showing 87 gb (dbsize) 25346.03MB(unallocated size)--unallocated size is showing same .please clarify.

1 Answers  


What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?

0 Answers  


Different Types of Functions ?

2 Answers   Satyam,


Categories