Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: max values

Re: max values

From: Douglas Whitacre <whitacre_at_imake.com>
Date: Tue, 12 Jan 1999 12:45:30 -0500
Message-ID: <77g1nn$rhg@world1.bellatlantic.net>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US