I have a SQL table with some redundant data as follows. (SQL Server 2012)
ColumnA(varchar) | ColumnB(varchar)
---------------- | ---------------
name1            | name2
name3            | name4
name2            | name1
name5            | name6
I need to select distinct data/rows from this table such that it will give me result as
ColumnA(varchar) | ColumnB(varchar)
---------------- | ---------------
name3            | name4
name2            | name1
name5            | name6
or
ColumnA(varchar) | ColumnB(varchar)
---------------- | ---------------
name1            | name2
name3            | name4
name5            | name6
Basically, name1 & name2 should be consider as unique if it is present as name2 & name1 (irrespective of order of column in which they are present).
I have no idea how can I filter the rows based on the strings being equal in different columns.
Can someone help me with this?

