This question is the continue of Select distinct substrings that are in a comma separated string | MySql. Based on the answer of these post I built this function:
create function function1(var1 int, str text)
returns text deterministic
return substring_index(substring_index(str, ",", var1), ",", -1);
that returns the substring that are before of the comma indicated by var1, so my idea was put this function in a while or other kind of loop and with a incremental variable handle the var1 and each return store it in a temporary table but I don't know how to do that exactly
Can someone give me a advice?