substring in sql code example
Example 1: sql substring
SUBSTRING(string, start, length)
Example 2: sql server substring
SELECT SUBSTRING('SQL Tutorial', 1, 3) AS ExtractString;
Example 3: sql substring
SELECT substr('Hello World', 4, 5) ;
SELECT substr('Hello World', 4);
SELECT substr('Hello World', -3);
Example 4: grab part of a string sql
SELECT
SUBSTRING('SQLTutorial.org',
POSITION('.' IN 'SQLTutorial.org'));
Example 5: substring sql
SELECT SUBSTR(first_name, 0 , 3)
From employees;
Example 6: substring sql
SELECT SUBSTRING('SQL Tutorial', 4, (LENGTH('SQL Tutorial'))
AS LastCharactersString;