Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: max values
Keith Gilbert wrote in message <77c121$5qq_at_bgtnsc02.worldnet.att.net>...
>It appears as though your code column is not numeric. Thus the first
>character '9' is interpreted as being the highest value. Try this after
>changing the code column to a numeric datatype:
>
>Select name, code
>from temp
>where code = (select max(code) from temp);
>
The above isn't going to get you the results you want. You have to make the conversion to a number. Either you have to change the datatype for the table, or you have to use a function to make the conversion.
Select code, name
from temp
where to_number(code) = select max(to_number(code)) from temp;
Not sure if there is an easier way or not. Received on Tue Jan 12 1999 - 11:45:30 CST
![]() |
![]() |