I have a table similar to what's below:
ID | VALUE |
---|---|
1 | A |
2 | A |
2 | B |
2 | C |
3 | B |
I want to return a single row when an ID has both A and B values in the VALUE column. The result I want would look like this:
ID | VALUE |
---|---|
1 | A |
2 | A & B |
2 | C |
3 | B |
How Do I combine those two rows into a single row?
This is the code I currently have
SELECT *
FROM TABLE
GROUP BY CASE WHEN VALUE IN(A) AND VALUE IN(B) THEN ID
ELSE 1 END;
However, it returns a blank table.