How can i retrieve data [message #20798] |
Thu, 20 June 2002 20:47 |
Laxman Chepuri
Messages: 8 Registered: May 2002
|
Junior Member |
|
|
i have one table 'x' in which empid is a column declared as varchar2(10)
data in that field is
1
2
3
4
a
5
c
6
d
Now i want to retrieve only numbers
my required output is
1
2
3
4
5
6
|
|
|
|
Re: How can i retrieve data [message #20806 is a reply to message #20798] |
Fri, 21 June 2002 09:11 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
No need for a user-defined function in this case, just use the built-in translate function:
sql>select * from x;
EMPID
----------
1
2
3
4
a
5
c
6
d
10
abc
abc10
10abc
13 rows selected.
sql>select * from x where translate(empid, '0123456789', ' ') is null;
EMPID
----------
1
2
3
4
5
6
6 rows selected.
|
|
|
|