May 16, 2021 MySQL
Intercept the string
Usage: substr (string string, num start, num length);
Select substr (parameter 1, argument 2, parameter 3) from the table name
String is a string, start is the starting position, and length is length.
Note: Starts with 1 in mysql.
Example: (Find out the first time in the kename field.) previous string)
select kename,substr(kename,1,locate('.',kename)) as subkename from web_dev_api where 1;
Intercept the first two characters