If I have something like table called mutable, for example, with this kind of data:
id size 1 100ml 2 30ml 3 6,7g 4 8,8kg 5 alfa 110v 6 beta 220v
How can I extract the number of a string and convert it to a float number. (At this case the ,
separates the decimal part from the integer one.
So, how can I perform a query to return something like this?:
id size finalSize 3 6,7g 6,7 4 8,8kg 8,8 2 30ml 30 1 100ml 100 5 alfa 110v 110 6 beta 220v 220
and this? (just the id`s):
id 3 4 2 1 5 6
P.S.: I need to do this with MySQL functions...
P.S.:2
I have tried search about match a regex using MySQL, but looks like there aren't functions to return the matched pattern.
Maybe if I create a function that replaces everthing that isn't a digit or ,
can solve the problem to me, but I couldn't find a way to do this. MYSQL REPLACE function doesn't use regex.