DECLARE @c varchar(100)
SET @c = '0116522656517989898'
SELECT SUBSTRING(STUFF(@c, 1, CHARINDEX('01',@c), ''), 0, CHARINDEX('17', STUFF(@c, 1, CHARINDEX('01',@c), '')))
Output:
1165226565
SET @c = '0116522656517989898'
SELECT SUBSTRING(STUFF(@c, 1, CHARINDEX('01',@c), ''), 0, CHARINDEX('17', STUFF(@c, 1, CHARINDEX('01',@c), '')))
Output:
1165226565
No comments:
Post a Comment