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: problem selecting max value

Re: problem selecting max value

From: rob <rob_at_dsdelft.nl>
Date: Wed, 10 Oct 2001 17:47:11 +0200
Message-ID: <9q1qhh$9hc$1@news.tudelft.nl>


> I have a column in a table that is a varchar2(15), right now this
> column only holds numbers. I try to select max(column_name) and I get
> 9999 as the result, but the max in that column is over 30000. Is this
> a problem with selecting max on a column that is varchar2? Or is
> there something else I should be looking at?
There is no problem with selecting max from a varchar but the sorting order is different.
select v from test order by v;
1
11
9
so max(v) = 9

select to_number(v) from test order by to_number(v); 1
9
11
so max(to_number(v)) = 11
> 7.3.4 - NT4

time to upgrade. Received on Wed Oct 10 2001 - 10:47:11 CDT

Original text of this message

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