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
123
A5
789
B1
I need to return the largest number (789 in this case) from the column while ignoring the non-numeric values of A5 and B1.
I have found solutions that use custom functions to solve the problem, but I need something that can be executed ad-hoc query without relying on custom functions or procs.