dimanche 19 avril 2015

Split String and Do Calculation in MySQL

Let's say I have given data as string:



+----------+
|Size |
+----------+
|15X10 |
|5X4 |
|3 |
|2X6X5 |
+----------+


I want to write this column as integer like this:



+----------+
|Size |
+----------+
|150 |
|20 |
|3 |
|60 |
+----------+


Some of them are multiply of three numbers, some of them just one number. I can split the string but cannot make MySQL to calculate the number. Thank you.


Aucun commentaire:

Enregistrer un commentaire