MySQL: Function to Split String Value Using Different Delimiters and Position

In this post, I am providing one function to split string by using different type of delimiters and position in MySQL.

I have created this function because splitting a string is a very common requirement for all MySQL Database Developer.

I have created this function in such a way that you guys can pass any type of delimiter and split your string, but you also require to pass position to get exact value.

I have also created a similar kind of split function for SQL Server.
You can visit this article here:

For example, we have one column EmployeeName and it contains both Firstname and Lastname which is sperated by space. I require to create two column EmployeeFirstName and EmployeeLastName.

Below is a function and full demonstration of this:

First, Create a user defined function:

Sample Executions:

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Leave a Reply

Be the First to Comment!

Notify of