I am trying to get unique rows based on unique values on multiple columns in SQL Server 2012.
Source Data:
UserId ---- P1 ---- P2 ------ P3
101 ------- NO ---- NO ------- YES
101 ------- NO ---- YES ------ NO
101 ------- YES ---- NO ------- NO
102 -------- NO ----- NO ------- NO
My source data has 'YES' in single columns for multiple rows.
I'm trying to get the result as follows:
Desired Output:
UserId ---- P1 ---- P2 ------ P3
101 ------- YES ---- YES ----- YES
102 -------- NO ----- NO ------- NO
Any ideas or code-sample will be greatly appreciated.
