I have following table. I want to delete duplicate rows and keep the one that has Name1 = Name2. So, in the example below row 2 and 4 should be removed.
ID | Name1 | Name2
1 | n1 | n1
1 | n1 | n2
2 | n1 | n1
2 | n1 | n2
How can I do this with SQL query ?