Home » Interview Q&A » Remove Cross duplicate rows in SQL

Remove Cross duplicate rows in SQL

Analyse Missing Index Sql Server
Difference between Hashtable and Dictionary

 

Remove Cross duplicate rows in SQL

Hello friends, I got one question from my friend who recently appeared for an interview, that how to remove cross duplicate rows in SQL.? So I was looking for a solution but after many failures I got correct solution. Let you explain the question and solution.

Following is my table:-

Remove Cross duplicate rows in SQL-1

Now I want Output like following:
Remove Cross duplicate rows in SQL-2

Using following easy and fast query you will get desired output:

You can also achieve this using WITH statement. I also got solution using WITH statement, but that will not as fast as above query.

You guys can try by your own and comment it. I would like to see more response from you.

Thanks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Time limit is exhausted. Please reload CAPTCHA.




DISCLAIMER:
The content is copyrighted to technothirsty.com and may not be reproduced on other websites without permission from the owner.You may contact us using the information below.