I am trying to extract the 7658 from string XYZ.ABC7658@YAHOO.CO.IN
.
Below is the query which I am trying and the output is also shown. However the query doesn't server the purpose.
Can you please help on this? (Running Query on Sybase ASE)
SELECT SUBSTRING('XYZ.ABC7658@YAHOO.CO.IN', PATINDEX('%[0-9]%', 'XYZ.ABC7658@YAHOO.CO.IN'),
LEN('XYZ.ABC7658@YAHOO.CO.IN')) as number
Go
Number
--------------
85@YAHOO.CO.IN