In database, it store values are
M2345
45
M345
E21
A3
is there a way to sort it correctly? like
A3
E21
45
M345
M2345
In database, it store values are
M2345
45
M345
E21
A3
is there a way to sort it correctly? like
A3
E21
45
M345
M2345
Assuming there can be at most one letter before the digits start, you could use a condition like this in your sorting definition:
ORDER BY CAST(IF(col REGEXP '^[a-z]', SUBSTRING(col, 2), col) AS SIGNED)
Unfortunately, MySQL doesn't have a replace function that can handle regular expressions, otherwise that would have been very helpful at this point.
You may also want to consider storing the numeric value itself in a separate calculated field for more efficient sorting.