Declaration
MID(str,pos,len)
Description
Returns a substring of str starting at position pos and with length len. If any parameter is NULL, the function returns NULL.
If
lenis not specified, the returned substring starts at positionposand ends at the end ofstr.When the
posvalue is negative, the starting position is determined by counting backward from the end to the beginning ofstr.An empty string is returned if
lenis less than or equal to 0, or if the starting position specified byposis invalid.
This function is an alias for SUBSTRING(str,pos,len).
Examples
obclient> SELECT MID('OceanBase',6);
+--------------------+
| MID('OceanBase',6) |
+--------------------+
| Base |
+--------------------+
1 row in set