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

Can an automatic recovery be initiated by a user?

0 Answers  


Explain the categories of stored procedure i.e. System stored procedure, local stored procedure, temporary stored procedure, extended stored procedure, remote stored procedure?

0 Answers  


What are the diifferences between the ms sql server vs mysql?

0 Answers  


Let us say the SQL Server crashed and you are rebuilding the databases including the master database what procedure to you follow?

2 Answers  


What is the process of indexing?

0 Answers  






How to generate random numbers with the rand() function in ms sql server?

0 Answers  


Define cross join in sql server joins?

0 Answers  


Can group functions be used in the order by clause in ms sql server?

0 Answers  


What is SubQuery in SQL Server 2008

0 Answers   HCL,


What types of replication are supported in sql server?

0 Answers  


Explain indexing and what are the advantages of it?

0 Answers  


do views contain data ?

0 Answers   MCN Solutions,


Categories