You can do this in SQL, although this is not very.
select distinct reverse(substring_index(reverse(substring_index(tags, ',', nn)), ',', 1)) as word from t cross join (select 1 as n union all select 2 as n union all select 3 as n union all select 4 as n) n having word is not null
You must be sure that the subquery n has at least the number of words in each tag.
Here is a SQLFiddle that demonstrates this.
This is a cross connecting the source data with sequential numbers. He then selects the nth value from the tag lines using substring_index() .
To get the maximum number of tags, you can do:
select max(length(tags) - length(replace(tags, ',', 1))+1 from t
source share