Given a CHAR or VARCHAR column in MySql, what I need is to convert it to a number so it can be summed up. For example, if the column name is CHAR1, the SELECT would be:
SELECT SUM(ConvertToNumber(CHAR1)) from TABLE1
The function ConvertToNumber
just needs to convert to a number, it doesn't matter which number as long as it always converts to the same.
Is this feasible with native or user defined functions?
UPDATE: To be clear, the values of CHAR1 can be any string of alphanumeric characters.