I need sql query which sums all of the possible raw pairs in the table.
My table looks like this :
ID | Name | Value 1 | A | 100 2 | B | 150 3 | C | 250 4 | D | 600
In this case the query output should be :
FistName | SecondName | Sum
A | B | 250
A | C | 350
A | D | 700
B | C | 400
B | D | 750
C | D | 850