This is not the question but it's similar.
First i solved the query by I using unary join and calculated what required (distance) now I want to count how many pairs have the shortest distance without duplication. Example
ID ID Distance
1 2 0.1
2 1 0.1
3 5 0.13
4 7 0.1
The answer should be 2 but I get 3 as I don’t know how to remove the duplication between 2,1 and 1,2.
Would anyone please help me the answer should be (number of pairs , shortest distance )