I have a database table where a specific field (e. g. ID) is specified as character.
This field contains a number.
Now I want to get the highest ID which is available in the database table.
This statement does not work, because the max value is only determined by the first character.
SELECT single * FROM <table>
WHERE id = (
SELECT MAX( id ) FROM <table>
Example: Entries in database table
The max value is here then 3 and not 10. -> only the first character will be checked