I don't know is it possible or not I have subject code stings like this
Math 451
Math 451a
Math 452
Math 452a
Math 452b
I want query that would sort these string like this
Math 451
Math 452
Math 451a
Math 452a
Math 452b
I tried
CAST(SUBSTR(subjects.code,INSTR(subjects.code, " ") + 1) AS UNSIGNED)
but not working as expected thank you for your any help and suggestions