SQL WHERE SUBSTRING 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
-- substr(string, start, [, length ])
SELECT substr('Hello World', 4, 5) ; -- lo Wo
SELECT substr('Hello World', 4); -- lo World
SELECT substr('Hello World', -3); -- rld
Example 4: how to fetch first 5 characters in sql
Select SUBSTRING(StudentName,1,5) as studentname from student