Re: single quote oracle select
Date: Fri, 25 Apr 2003 16:51:41 +0200
Message-ID: <1051281963.851745_at_news.thyssen.com>
"oranewbie" <kellywh_at_hotmail.com> schrieb im Newsbeitrag
news:947ef647.0304250624.43f275ba_at_posting.google.com...
Hi,
> 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.
no it's because your column isn't NUMBER. So it's treated as
string. Therefor '114' < '69'.
Greetings,