How to obtain unique values from a set of columns for each row in a table.
Consider the following table structure:
COL1 | COL2 | COL3 | COL4
--------------------------
1 | 1 | 2 | 3
2 | 2 | 2 | 4
4 | 5 | 6 | 7
The desired result should look like this:
COL1 | COL2 | COL3 | COL4
--------------------------
1 | 2 | 3 | NULL
2 | 4 | NULL | NULL
4 | 5 | 6 | 7
I was able to achieve this by case statements by comparing each columns with each other. Are there any other way to do this?