I have a table with a text column that can contain a single word, more words separated by a space or a NULL
value. I need to get all the distinct words in that column (words non column entries).
For getting all the distinct column entries I use
SELECT DISTINCT(col_name) AS col_name FROM table_name ORDER BY col_name ASC
but I don't know how to get all the distinct words.
Best Answer
You can see it here: http://sqlfiddle.com/#!2/b5be5/2/0
reference: https://stackoverflow.com/questions/17942508/sql-split-values-to-multiple-rows