Varsha
Answered On : Dec 8th, 2011
This can be done by using the TRANSLATE function as it replaces character by character.

1 User has rated as useful.
Login to rate this answer.
Swathy
Answered On : Dec 12th, 2011
Varsha could you please write the query for this above question?
Login to rate this answer.
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 )
Login to rate this answer.
sanjay
Answered On : Jan 5th, 2012
Code
SELECT REPLACE(TRANSLATE(909090abc4567d,a,b,c,d,e,f,g, ), ,) FROM dual

1 User has rated as useful.
Login to rate this answer.
sriram
Answered On : Feb 24th, 2012
Code
SELECT columnname FROM tablename WHERE regexp_like(columnname,^[[:digit:]]+$) ;
Login to rate this answer.
naga
Answered On : Mar 12th, 2012
Code
SELECT REPLACE(TRANSLATE(LOWER(99sAmn44423mz44),abcdefghijklmnopqrstuvwxyz, ), ,) FROM dual
Login to rate this answer.
Abhishek
Answered On : Aug 23rd, 2012
Code
declare @temp_numeric TABLE (value nvarchar(500))
declare @i int=1,@len int,@ans nvarchar(100)=,@str nvarchar(100)
DECLARE @count INT
SELECT VALUE INTO #temp FROM dbo.numeric
SELECT * FROM #temp
SET @count=(SELECT COUNT(*) FROM dbo.#temp)
WHILE(@count>0)
BEGIN
SET @str = (SELECT TOP (1) value FROM #temp)
SET @len=(SELECT LEN(@str))
while(@i<=@len)
BEGIN
IF(isnumeric(SUBSTRING(@str,@i,1))=1)
begin
SET @ans=@ans+(SELECT SUBSTRING(@str,@i,1))
end
SET @i=@i+1
END --inner loop ends
DELETE TOP(1) FROM #temp
SET @count=(SELECT COUNT(*) FROM #temp)
INSERT INTO @temp_numeric VALUES(@ans)
SET @i=1
SET @ans=
END --outer while loop
SELECT * FROM @temp_numeric
DROP TABLE #temp
Login to rate this answer.