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

Home -> Community -> Usenet -> c.d.o.server -> Re: An urgent Sql question help Please !

Re: An urgent Sql question help Please !

From: Jason Jay Weiland <archduke_at_uclink4.berkeley.edu>
Date: Thu, 22 Oct 1998 16:27:49 -0700
Message-ID: <362FBF75.B9786DFC@uclink4.berkeley.edu>


Mujahid,

     Try TRANSLATE

SQL> SELECT translate('1ab2c', '1abcdefghijklmnop', '1')   2 FROM dual;

TR
--
12

...and you specify as many replacement characters that you need to update with TRANSLATE. The '1' > '1' is a bit of a hack, but you need to specify something since an empty string is interpreted as a NULL.

Jay!!!

MUJAHID HAMID wrote:

> Dear All.
>
> I want to remove characters from a column when I select from it but keep
> numbers from it
> e.g. Table1:
> col1
> ====
> 1234
> 123a
> 12b4
> ab34
> I would like to select all the rows from this table but with characters
> filtered out.
> I like to get the following result from the query
>
> col1
> ====
> 1234
> 123
> 124
> 34
>
> and if possible just select the rows with number only and no characters in
> it.
>
> With Thanks in advance
>
> Mujahid_at_pharmco.demon.co.uk
Received on Thu Oct 22 1998 - 18:27:49 CDT

Original text of this message

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