And SQL Substring function allow us to extract a character or set of characters from a string. A SQL Substring is a query inside another SQL query and embedded inside the WHERE clause. A subquery is utilized to return information that will be utilized as a part of the primary query as a condition to assist limit the information to be recovered.
SUBSTRING(string, starting_position, length)
string => String from where the character set has to be extracted.
starting_position => The position to start extraction from. The first position in the string is always 1.
length => Number of characters want to extract from the starting position.
sql>SELECT SUBSTRING('SPLessons.com', 1 , 5); Output of the above query SPLes
sql>SELECT SUBSTRING('SPLessons.com', 5 , 5); Output of the above query sons