Home » SQL & PL/SQL » SQL & PL/SQL » Problem on Sql Query
Problem on Sql Query [message #21316] Thu, 25 July 2002 21:25 Go to next message
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 Go to previous message
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)
Previous Topic: START command in SQL*PLUS with pathname ?
Next Topic: Re: Record has been updated by another user
Goto Forum:
  


Current Time: Thu Apr 25 03:28:55 CDT 2024