Get Numeric Values only using SQL ?

I have table with one column. type varchar..
PHONE
---------------
99samn44423m44
8034skdf3453a2
909090abc4567d
i want to get numeric values.. i mean my output will be
PHONE
---------------
994442344
80343453a2
9090904567
thanks in advance..
Sateesh

Questions by sateesh44   answers by sateesh44

Showing Answers 1 - 13 of 13 Answers

Varsha

  • Dec 8th, 2011
 

This can be done by using the TRANSLATE function as it replaces character by character.

Swathy

  • Dec 12th, 2011
 

Varsha could you please write the query for this above question?

  Was this answer useful?  Yes

kirathakudu

  • Dec 13th, 2011
 

translate(PHONE,[a,b,c,d,e,f..etc],SPACE)

where ever there is an alphabet it will be replaced by space

eg:

PHONE = 32663cdefh3456
after translate PHONE = 32663 3456

translate( string1, string_to_replace, replacement_string )

  Was this answer useful?  Yes

sriram

  • Feb 24th, 2012
 

Code
  1.  

  Was this answer useful?  Yes

Abhishek

  • Aug 23rd, 2012
 

Code
  1. span style="color: #808080; font-style: italic;">#temp FROM dbo.numeric

  2. #temp

  3. #temp)

  4. #temp)

  5. --inner loop ends

  6. #temp

  7. #temp)

  8. --outer while loop

  9. #temp


  Was this answer useful?  Yes

stalink

  • Sep 22nd, 2014
 

DECLARE @Temp VARCHAR(100)=(StalinKIN095815)
Declare @NumRange as varchar(50) = %[0-9]%
While PatIndex(@NumRange, @Temp) > 0
Set @Temp = Stuff(@Temp, PatIndex(@NumRange, @Temp), 1, )

SELECT @Temp

  Was this answer useful?  Yes

rajesh anasuri

  • Sep 3rd, 2015
 

SELECT REGEXP_REPLACE(AB12CD34EF,[A-Z], ) FROM DUAL ;

  Was this answer useful?  Yes

Krishna

  • Mar 30th, 2016
 

Code
  1.  

  Was this answer useful?  Yes

Ganezh

  • Apr 20th, 2016
 

Code
  1.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions