To get the list of distinct values from table1 and column1 is as easy as doing this:
SELECT distinct(column1)
FROM table1
However, I inherited (unfortunately) a database where column1 contains values separated by a comma
column1
--------
row 1: name1,name2
row 2: name2,name3
row 3: name4,name1,name3
I need to get the list of distinct values from column1, so it looks like this:
column1
--------
name1
name2
name3
name4
Any ideas?