SQL to get distinct record for a combination of two column (Irrespective of order)
问题 Consider the below Table structure and data CREATE TABLE Distance( source VARCHAR(20), destination VARCHAR(20), distance INTEGER ); Select * from Distance; source destination distance ======= =========== ====== Chennai Mumbai 500 Mumbai Chennai 500 Mumbai Bangalore 500 Bangalore Mumbai 500 Goa Mumbai 100 Mumbai Goa 100 Kolkata Goa 1000 I need the output to have single record for 2 cities if repeating, i,e, any one record among the below 2 is fine. Chennai Mumbai 500 Mumbai Chennai 500