Fun at zangOOr Click Here
2 like 0 dislike
37 views
in Education & Reference by (1.4k points)
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

1 Answer

0 like 0 dislike
by (3.3k points)
 
Best answer

Use

SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(column,'-', 1),'/',-1) as value 

Related questions

2 like 0 dislike
1 answer 60 views
1 like 0 dislike
1 answer 2.4k views
0 like 0 dislike
1 answer 811 views
0 like 0 dislike
1 answer 577 views
1 like 0 dislike
1 answer 81 views
1 like 0 dislike
1 answer 619 views
0 like 0 dislike
1 answer 175 views
0 like 0 dislike
3 answers 799 views
...