Problem on Sql Query [message #21316] |
Thu, 25 July 2002 21:25 |
Laxman Chepuri
Messages: 8 Registered: May 2002
|
Junior Member |
|
|
I have one table named as 'TOAP' with one field 'num'
Data in the table is
num
----
000000
12abc
455
hello
233
AB44BB00
56A33CC
0000000c
1234
1000000A
Hyd12
Write a query to retrieve only numbers
Output should be
num
----
000000
455
233
1234
|
|
|
Re: Problem on Sql Query [message #21318 is a reply to message #21316] |
Thu, 25 July 2002 21:51 |
Laxman Chepuri
Messages: 8 Registered: May 2002
|
Junior Member |
|
|
I got two solutions but if anybody found any better
solution please send.
Select num from TOAP where translate(num,'*1234567890',' ') is null
select num from TOAP where num in
(select translate(num,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','a') from TOAP)
|
|
|