Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select only numeric values from varchar2 column
Hi,
As I read your posting, you only want columns where all the characters are numeric. Can't see any other way than the hard one:
select col1
from toto
where (substr(col1,1,1) in ('0','1','2',.....'9'))
and (substr(col1,2,1) in ('0','1','2',.....'9') or substr(col1,2,1) is
null)
and (substr(col1,3,1) in ('0','1','2',.....'9') or substr(col1,3,1) is
null)
and (substr(col1,4,1) in ('0','1','2',.....'9') or substr(col1,4,1) is
null)
. . .
Hope you table is not too big!
Regards,
Michael Ringbo
Bruno Decraene wrote:
> I have a table toto with varchar column col1
>
> col1 contains alphanumeric values and numeric values and i want to
> select only the numeric values
>
> How can i do this
>
> Thank you
>
> ansewer to me to rchennaa_at_atos-group.com
>
> Rach
Received on Tue Jul 20 1999 - 04:03:27 CDT
![]() |
![]() |