Unix Technical Forum

select only number from varchar2

This is a discussion on select only number from varchar2 within the Oracle Database forums, part of the Database Server Software category; --> for example I have this records in varchar2 column: A123D BLA124XX 125 lkl567836785366AW 2Q and now I need select ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-22-2008, 05:25 PM
 
Posts: n/a
Default select only number from varchar2

for example I have this records in varchar2 column:

A123D
BLA124XX
125
lkl567836785366AW
2Q

and now I need select only number for spool :

123
124
125
567836785366
2


Have you any idea?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-22-2008, 05:26 PM
Rauf Sarwar
 
Posts: n/a
Default Re: select only number from varchar2

<rx@wo.cz> wrote in message news:<av6tdv$clm6a$1@ID-123390.news.dfncis.de>...
> for example I have this records in varchar2 column:
>
> A123D
> BLA124XX
> 125
> lkl567836785366AW
> 2Q
>
> and now I need select only number for spool :
>
> 123
> 124
> 125
> 567836785366
> 2
>
>
> Have you any idea?



Look up usage of TRANSLATE(char, from, to). Here is a quick short example,

SQL> SELECT TRANSLATE('AB123CD', '123ABCD', '123') FROM DUAL;

TRA
---
123

/Rauf Sarwar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:48 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com