Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: having a senior moment and can't fingure

Re: having a senior moment and can't fingure

From: David Sharples <davidsharples_at_gmail.com>
Date: Tue, 26 Oct 2004 17:07:37 +0100
Message-ID: <be592d5504102609074c990f16@mail.gmail.com>


SQL> select * from t1;

D



1234
12345
ABCDEF5
ABCD
A1B2

SQL> select d from t1 where length(d) = 4 and d between '0000' and '9999';

D



1234

seems to work for me ?

On Tue, 26 Oct 2004 10:50:44 -0500, Duret, Kathy <kduret_at_starkinvestments.com> wrote:
> select symbol from table where type = 2 and
> length(symbol) = 4 and
> (substr(symbol,1,1)) between '0' and '9' and
> (substr(symbol,2,1)) between '0' and '9' and
> (substr(symbol,3,1)) between '0' and '9' and
> (substr(symbol,4,1)) between '0' and '9'
>
> I did this but I thought there was a better way
>
> Kathy
>
>
> > -----Original Message-----
> > From: Duret, Kathy
> > Sent: Tuesday, October 26, 2004 10:41 AM
> > To: Oracle L (E-mail)
> > Subject: having a senior moment and can't fingure
> >
> > I am having a senior moment today .....
> >
> > sI want to get only those varchar2 fields back with a length of 4 that are
> > numeric
> >
> > select field from table where length(field) = 4 and
> >
> > between '0001' and '9999' - I used this but I get alpha characters back.
> >
> > I know it is something simple but I am just going blank.
> >
> > Kathy
> >
> >
> >
> >
> >
> >
> This transmission contains information solely for intended recipient and may
> be privileged, confidential and/or otherwise protect from disclosure. If
> you are not the intended recipient, please contact the sender and delete all
> copies of this transmission. This message and/or the materials contained
> herein are not an offer to sell, or a solicitation of an offer to buy, any
> securities or other instruments. The information has been obtained or
> derived from sources believed by us to be reliable, but we do not represent
> that it is accurate or complete. Any opinions or estimates contained in
> this information constitute our judgment as of this date and are subject to
> change without notice. Any information you share with us will be used in
> the operation of our business, and we do not request and do not want any
> material, nonpublic information. Absent an express prior written agreement,
> we are not agreeing to treat any information confidentially and will use any
> and all information and reserve the right to publish or disclose any
> information you share with us.
> --
> http://www.freelists.org/webpage/oracle-l
>

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Oct 26 2004 - 11:04:30 CDT

Original text of this message

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