Re: single quote oracle select

From: Ethel Aardvark <bigjobbies_at_hotmail.com>
Date: 30 Apr 2003 02:14:51 -0700
Message-ID: <1a8fec49.0304300114.732aceca_at_posting.google.com>


Quite agree.

To rely on ANY implicit type conversions (in almost ANY language) is asking for problems and bugs that can be SOOO easily avoided!!

ETA "Guido Konsolke" <Guido.Konsolke_at_triaton.com> wrote in message news:<1051281963.851745_at_news.thyssen.com>...
> "oranewbie" <kellywh_at_hotmail.com> schrieb im Newsbeitrag
> news:947ef647.0304250624.43f275ba_at_posting.google.com...
> > Hi,
> > I have an oracle table like the following:
> >
> > SQL> describe platform;
> > Name Null? Type
> > --------------------------------------------
> > id varchar2(9)
> >
> >
> > But when I try to get a simple select statement. I got an erorr:
> >
> > select id, count(*) from platform where id > '69'
> >
> > But it only returns a max id and count up to 99 when there are id's up
> > to 114 in this table
> >
> >
> > When I run the following query I get id's that are above 69 as
> > expected.
> > select id, count(*) from platform where id > 69
> >
> >
> > However what is confusing is when I run the query below:
> > select id, count(*) from platform where id > '100'
> >
> > This returns all the id's and counts from 0-114. I would think that
> > it would only return id's above 100. Can anyone explain the
> > difference in using a single quote vs not using one?
> >
> >
> >
> > Is that I must use a single quote? Is that oracle on NT is not case
> > sensitive? Since I can use upper and lower case for table name.
> > Thanks.
>
> Hi,
>
> no it's because your column isn't NUMBER. So it's treated as
> string. Therefor '114' < '69'.
>
> Greetings,
> Guido
Received on Wed Apr 30 2003 - 11:14:51 CEST

Original text of this message