Re: Is the range regular expression [1-9] valid in Oracle SQL?
Date: Sat, 11 Nov 2000 09:18:30 -0800
Message-ID: <t0r3ui4hdtjr00_at_corp.supernews.com>
"Zhang, Leon Lin" <leonz_at_gdc.lucent.com> wrote in message
news:3A0A790E.3DA9D5FA_at_gdc.lucent.com...
> Hi friend,
>
> Does anyone have any ideas on the following problem/question?
>
> I created one table about login information in oracle8.0.5. In it one field
is
> login name and its data type is varchar2(8). I have known there are 9 rows in
> which the value of the 'login' field are from 'stud1' to 'stud9'. So I wanted
to
> try the rang regular expression [1-9] in the following format.
> select * from <table_name> where login like 'stud[1-9]';
> But it showed no rows selected. I guessed the Oracle didn't think that the
[1-9]
> is a range regular expression. If I omitted the pair of single quotation
mark.
> It will be failed.
>
> Would you like to help me look into this problem? I just know that in Ingres
the
> range regular expression [1-9] will be accepted, but it must go with 'escape'
> operator.
>
> Thanks a lot!!
>
> Leon L. Zhang
Try:
select *
from <table_name>
where login between 'stud1' and 'stud9'
and length(login) = 5;
-Matt Received on Sat Nov 11 2000 - 18:18:30 CET
