How can I update a column in a table with a value from other column for all possible combinations ?
Example:
COL1 | COL2 | COL3 | ClientKey | MasterKey
-----+-------+-------+------------+------------
123 | 345 | 678 | AAA | AAA
N/A | 345 | 678 | BBB | AAA
N/A | N/A | 678 | CCC | AAA
N/A | 345 | N/A | DDD | AAA
123 | 345 | N/A | EEE | AAA
123 | N/A | 678 | FFF | AAA
First row has all values populated and it has a key (ClientKey). How do I update MasterKey column with ClientKey column checking for all possible combinations that can occur with the first row. 'N/A' value is equivalent to NULL value.