substring charindex sql code example
Example 1: sql substring
SUBSTRING(string, start, length)
Example 2: charindex
DECLARE @document VARCHAR(64);
SELECT @document = 'Reflectors are vital safety' +
' components of your bicycle.';
SELECT CHARINDEX('bicycle', @document);
GO
Example 3: substring sql
SELECT SUBSTRING('SQL Tutorial', 4, (LENGTH('SQL Tutorial'))
AS LastCharactersString;
//Result -> Tutorial