My postgresql column structure looks like this:
id | from | to
---------------
1 | A | B
2 | A | B
3 | C | D
Now I want an result which looks like this:
res
-----
'A:B'
'B:A'
'C:D'
'D:C'
where the first and the rows are permuted from A:B to B:A and 'C:D' to 'D:C' and the second column is omitted due to distinct operation.