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:

enter image description here

using function, result be:

enter image description here

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

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -