I am essentially trying to accomplish this following:
Table 1:
MemberID | selection 1 | selection 2 | selection 3
-----------------------------------------------------------------------
12345 | A | |
12345 | | B |
12345 | | | C
Transforms into
Table 2:
MemberID | selection 1 | selection 2 | selection 3
-----------------------------------------------------------------------
12345 | A | B | C
Part of me thinks a ‘UNION’ is the way to go but this is normally reserved for columns into rows I believe.
Any ideas?
My first thought is an aggregation trick. Are the columns without data NULL or just blank? Perhaps the values sort above or below the blank columns. In that case:
SELECT MAX(column1),MAX(column2),MAX(column3) FROM table GROUP BY MemberID;