I have a table similar to the following:
value unit
----- -----
100 cm
30 in
120 cm
35 in
37 in
29 in
In my selection, I’d like to convert inches to centimeters. Something like the following:
SELECT AVG(unit = in ? value*2.54 : value) FROM data_table;
What is the proper syntax, or method to perform this type of selection in MySQL?
1 Answer