I have a column that has a string in it as follow
Data
black83736
white87
white893
pink82928
pink1
black27
...
...
I want to just get the digits out of that column.
Edit
I would prefer mysql solution
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this mysql Solution :
(updated)
this is for your particular case, where you want the numbers in the end.
so first we
Reverse, so numbers come to beginningformat, so alphabets are removed, format is used for formatting a number with specified decimal places, here we specify it to 0.reverseagain -> to obtain the original numberreplace‘,’ to ” -> to remove the effect of formatting of second step.**
(UPDATE)
**
the above solution doesnt work for numbers ending in 0’s (thanks to karolis for telling)
so for that
Here we are appending ‘9099’ to the end of the number, and then removing 9099 in the end.
9099 ? just a number which would be highly in-probable to occur in your columns