I am trying to retrieve the largest number from a varchar column that includes both numbers and strings. An example of the data I\'m working with:
BoxNumber
SELECT MAX(CAST(value as signed)) FROM yourTable WHERE VALUE NOT LIKE '%[a-z]%' AND ISNUMERIC(VALUE) = 1
In MySql
You should use signed instead of int to cast correctly.
P.s types used to cast may differ in MySql
For more conversions visit this link