I have a column in a MySQL table that consists of comma-delimited strings. I would like to convert this column into a set of distinct strings that occur in the column (for any row in the table — the set includes strings that occur in any row of the table in this column). What is the easiest way to accomplish this?
The solution doesn’t need to be pure MySQL. It could involve unix, perl, etc.
The way I chose was to run the select mysql command outside of the mysql shell and pipe the results into tr and sort –uniq
This is pretty simple and seems to give the correct results as far as I can tell.