PostgreSQL select unique rows based on any combinations of 2 cols
I have a table like below: city1 city2 dist New York Berlin 7900 Berlin New York 7900 Oregon Ohio 5700 Montreal Rio 5700 Ohio Oregon 5700 Rio Montreal 5700 Moscow Tokyo 4200 Tokyo Moscow 4200 Both row 1 and row…