mysql - Create a function to split delimited string into a table -
in order split delimited string, need creation of function returning table , taking comma separated string parameter.
for instance, have @ input table:
using function, result be:
in case, delimited string person column should taken parameter.
thanks in advance.
try query
//which work when having 3 comma select id,substring_index(substring_index(`person`, ',', 1), ',', -1) person `table` union select id,substring_index(substring_index(`person`, ',', 2), ',', -1) person `table` union select id,substring_index(substring_index(`person`, ',', 3), ',', -1) person `table` order id asc
Comments
Post a Comment