Order by on an alphanumerical column I have a column that has strings of the following type:
Miller 10
Allen 20
King 10
....
Jones 100  

I try to sort the column based on the numerical part of the data.
I tried the following:  

SELECT * FROM the_table ORDER BY CAST(RIGHT(data,2) AS UNSIGNED);  

But this does not work. It places Jones 100 as the first entry etc.  

What am I doing wrong?
MySQL has a built-in function for parsing texts in the form of SUBSTRING_INDEX().

This simplifies your query to:

SELECT * FROM the_table
ORDER BY CAST(SUBSTRING_INDEX(data,' ',-1) AS UNSIGNED);