I have a column in table A that takes the following values.
"1,2,3", "1,2", "2,1", "3,2"
I have another table B that has the following records.
("1","one"),("2","two"),("1","three")
I would like to get the following.
"one,two,three", "one,two", "two,one", "three,two"
How do I do this in MySQL?
I have tried the following.
select
A.comma_separated_numbers,
group_concat(distinct B.word separator ',') as comma_separated_words
from A inner B
on find_in_set(B.number, A.comma_separated_numbers)>0
;