Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: problem selecting max value
> 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
![]() |
![]() |