Path: news.easynews.com!easynews!news-xfer.siscom.net!isdnet!surfnet.nl!tudelft.nl!not-for-mail
From: "rob" <rob@dsdelft.nl>
Newsgroups: comp.databases.oracle.server
Subject: Re: problem selecting max value
Date: Wed, 10 Oct 2001 17:47:11 +0200
Organization: Delft University of Technology
Lines: 23
Message-ID: <9q1qhh$9hc$1@news.tudelft.nl>
References: <25f83890.0110100736.235027bc@posting.google.com>
NNTP-Posting-Host: pc-laarhoven.dto.tudelft.nl
X-Trace: news.tudelft.nl 1002728817 9772 130.161.221.131 (10 Oct 2001 15:46:57 GMT)
X-Complaints-To: usenet@news.tudelft.nl
NNTP-Posting-Date: Wed, 10 Oct 2001 15:46:57 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Xref: easynews comp.databases.oracle.server:120831
X-Received-Date: Wed, 10 Oct 2001 08:54:43 MST (news.easynews.com)

> 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.



