I have a table lets say Tab1
id | dt | price |
---|---|---|
1 | 01/01/2021 | 50 |
2 | 01/22/2021 | 70.8 |
1 | 01/01/2021 | 49.99 |
2 | 01/21/2021 | 69 |
1 | 01/14/2021 | 54 |
Now, I must delete all the rows that have duplicate date and id column, irrespective of the value column (any one can stay, because values will be very near) So, the final table after the operation would be
id | dt | price |
---|---|---|
1 | 01/01/2021 | 50 |
2 | 01/22/2021 | 70.8 |
2 | 01/21/2021 | 69 |
1 | 01/14/2021 | 54 |
(No order necessary)
What is the fastest way in terms of time taken to run the query, to solve this?
My Question and this question is different as not all the columns of the duplicate rows of mine are same How to delete duplicate rows in SQL Server?