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

Home -> Community -> Usenet -> c.d.o.misc -> Re: select only data with numbers from alphanumeric field

Re: select only data with numbers from alphanumeric field

From: isa <isapmon_at_terra.es>
Date: Wed, 16 Oct 2002 18:19:57 GMT
Message-ID: <h5ir9.843282$sI1.6825173@telenews.teleline.es>


Hi:

I only know the next solution:

  where substr(columnname,1,1) between 'A' and 'z' and

            substr(columnname,2,1) between 'A' and 'z' and
            substr(columnname,3,1) between 'A' and 'z' and
            substr(columnname,4,1) between 'A' and 'z' and
            substr(columnname,11,1) between '0' and '9' and
            substr(columnname,12,1) between '0' and '9' and
            substr(columnname,13,1) between '0' and '9' and
             .................

Regards,

                             Isa

"Richard Brust" <brust_at_tbri.com> escribió en el mensaje news:f12180f2.0210160739.7a807e38_at_posting.google.com...
> the field is VARCHAR2(20)
>
> first four are letters
> next 7 could be a mixture of letters/numbers
>
> (most data in this column is 11 chars wide, some are more)
>
> what I want to do is create a query like this:
>
> select columnname from tablename
> where columnname LIKE 'ABCD______#';
> ---------------------------^^^^^^ (6 spaces)------
>
> so, the first four would be a specific letter sequence,
> the next 6 could be whatever,
> and the last "thing" would be a number.
>
> Thank you very much...
Received on Wed Oct 16 2002 - 13:19:57 CDT

Original text of this message

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