How to find unique values from a column that has multiple values separated by a space.
For example, I have four categories namely A, B, C and D. First two rows have the categories A, B and C and last two rows have categories B, C and D.
Categories
----------
A B C
A B C
B C D
B C D
I want to get the unique values which are A, B, C, D
But if I write the following query it will give me the following result which is not desired:
SELECT DISTINCT categories from table
Categories:
A B C
B C D
Desired result is following:
Categories
-----------------
A
B
C
D