SUBSTR function extracts a substring. A multibyte character, such as a Chinese character and a full-width character, is calculated as one character.
The string to be truncated. The string type can be
The start position for truncating the string. If n1 is equal to 0 or 1, the string is truncated from the first character.
The length of the truncated string. If you do not specify
The data that has the same type as
c1 is returned. If
n2 is 0, it is considered as 1. If
n2 is positive, ApsaraDB for OceanBase searches for the first character from the beginning of
n2 is negative, ApsaraDB for OceanBase counts backward
c1 from the end of
n3 is omitted, ApsaraDB for OceanBase returns all the characters of
n3 is less than 1, ApsaraDB for OceanBase returns
Execute the following statement:
SELECT SUBSTR('13088888888',3,8) test FROM DUAL;
The following query result is returned:
+----------+ | TEST | +----------+ | 08888888 | +----------+