Monday, December 5, 2011

Charindex in sql

SET @FullName = 'www.java2s.com'
SET @SpaceIndex = CHARINDEX('java', @FullName)
SELECT LEFT(@FullName, @SpaceIndex - 1)

No comments:

Post a Comment