This tutorial explains how to use the MySQL SUBSTRING function with syntax and examples.
The MySQL SUBSTRING function allows you to extract a substring from a string.
The syntax for the SUBSTRING function in MySQL is:
OR
The source string.
The position for extraction. The first position in the string is always 1.
Optional. It is the number of characters to extract. If this parameter is omitted, the SUBSTRING function will return the entire remaining string.
The SUBSTRING function can be used in the following versions of MySQL:
Let's look at some MySQL SUBSTRING function examples and explore how to use the SUBSTRING function in MySQL.
For example: