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: Wierd problem, max(column_name) gives different result thanmax(to_number(column_name))

Re: Wierd problem, max(column_name) gives different result thanmax(to_number(column_name))

From: Alton Ayers <altona_at_ditw.com>
Date: Mon, 21 Sep 1998 15:22:05 -0400
Message-ID: <3606A75D.DD9FE2BF@ditw.com>


Only the length of the number after the "to_number". Check the length befor doing the to_number.

tony wrote:

> The lenght is the same for both
>
> In article <3606801B.7E6298CE_at_ditw.com>, Alton Ayers <altona_at_ditw.com> wrote:
> >If 1080101 has a leading space (or spaces) you will get this result since
> >'1044241' is greater than ' 1080101'.
> >
> >tony wrote:
> >
> >> I have a table that includes an equipment number (eqnum). It is a varchar
> >> field. When I do a
> >>
> >> select max(eqnum) I get 1044241
> >>
> >> when i do a
> >>
> >> select max(to_number(eqnum) I get 1080101
> >>
> >> the lengths are the same a
> >> SELECT max(eqnum), max(to_number(eqnum)), length(max(eqnum)),
> >> length(max(to_number(eqnum)))
> >> gives
> >> 1044241 1080101 7 7
> >>
> >> why the difference??
> >> isn't a number in a varchar field the same as a number in an integer field?
> >>
> >> respond to group or ramdan_at_mailexcite.com
> >
Received on Mon Sep 21 1998 - 14:22:05 CDT

Original text of this message

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