Skip to Content
0
Former Member
Oct 06, 2009 at 11:22 AM

Sort table field from type character

62 Views

Hi all,

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>

INTO <workarea>

WHERE id = (

SELECT MAX( id ) FROM <table>

).

Example: Entries in database table

ID

1

10

2

3

The max value is here then 3 and not 10. -> only the first character will be checked

Any ideas?

regards