DECLARE @strString VARCHAR(50)
SET @strString = 'SUBSTRING'
SELECT SUBSTRING(@strString,1,1) AS STRSTRING
Result:S
SELECT SUBSTRING(@strString,1,2) AS STRSTRING
Result:SU
SELECT SUBSTRING(@strString,1,3) AS STRSTRING
Result:SUB
SELECT SUBSTRING(@strString,1,4) AS STRSTRING
Result:SUBS
SELECT SUBSTRING(@strString,1,5) AS STRSTRING
Result:SUBST
SELECT SUBSTRING(@strString,1,6) AS STRSTRING
Result:SUBSTR
SELECT SUBSTRING(@strString,1,7) AS STRSTRING
Result:SUBSTRI
SELECT SUBSTRING(@strString,1,8) AS STRSTRING
Result:SUBSTRIN
SELECT SUBSTRING(@strString,1,9) AS STRSTRING
Result:SUBSTRING
SELECT SUBSTRING(@strString,3,9) AS STRSTRING
Result:BSTRING
SELECT SUBSTRING(@strString,-5,9) AS STRSTRING
Result: SUB
SELECT SUBSTRING(@strString,-7,9) AS STRSTRING
Result:S
Saturday, January 16, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment