Claim your Biolink Click Here
2 like 0 dislike
292 views
I want equivalent of explode() to work with strings in MySQL

I have a Cloumn Value in DB is "REF/123456-0001"

I need a value of only 123456
in Education & Reference by (1.6k points) | 292 views

1 Answer

0 like 0 dislike
Best answer

Use

SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(column,'-', 1),'/',-1) as value 
by (4.7k points)

Related questions

2 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
3 like 0 dislike
2 answers
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked May 26, 2015 in Education & Reference by Simmi (830 points) | 449 views
0 like 0 dislike
3 answers
asked Jan 20, 2014 in Education & Reference by Sam (1.6k points) | 1.9k views

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,312 questions
1,473 answers
569 comments
4,809 users