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

when you create a database how is it stored? : Sql server database administration

0 Answers  


How to delete an attribute from the emp table

4 Answers  


What is difference between temp table and cte?

0 Answers  


What is rank function?

0 Answers  


What does it mean to invest in the index?

0 Answers  






Can you create UNIQUE and PRIMARY KEY constraints on computed columns in SQL Server 2000?

3 Answers   Infosys,


What is set nocount on?

0 Answers  


what is the difference between Delete and Truncate

4 Answers   CarrizalSoft Technologies, Geo Research Centre,


What languages bi uses to achieve the goal?

0 Answers  


Hi SQL gurus, i am working for an MNC... My team is having a problem in sql server. when user slects date prompts from jan 1st to april 30, it should display all months data like : jan aa feb bb mar cc but when it comes to april its taking data like : jan aa feb bb mar cc apr dd...and so on means its taking data again from jan to april which we dont want. we want the data only april month as we are getting jan, feb and mar... can any one write the code to relsove the issue please would be greatful if you can send to shiva_sans@yahoo.co.in and also please send your email also ...so that we will be in touch for any kind of queries ... Thanks a lot in Advance !!!

1 Answers  


what is replication? where do u use Go Keyword?

1 Answers   Satyam,


What happens if time-only values are provided as date and time literals?

0 Answers  


Categories