find out numbers | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

find out numbers

Hi, I have data like this, i want to find out the required value. Col1
—-
abcdeff9.9.9.9sadfjkjksd
uytuyt1.3.5ughjghjghj
jkhjkhjk4.2.5kjjkjkj i want out put as like this col1
—-
9.9.9
1.3.5
4.2.5 advance thanks SURYA
How about select
substring( col1,
patindex( ‘%[0-9]%’, col1 ),
len( col1 ) – patindex( ‘%[0-9]%’, col1 ) – patindex( ‘%[0-9]%’, reverse( col1 ) ) + 2 )
from #t
assuming that the digits are always consecutive and always present…? otherwise need to include a bit more checking in the select… Cheers
Twan
THANKS A LOT SURYA
]]>