Common string interception function in Oracle and MySQL - substr()

       String interception is a very common operation in SQL statements. Oracle and MySQL strings are slightly different in string interception. The string interception function in Oracle is substr(), while the character string in MySQL String interception functions can be substr() and substring(). Obviously, no matter Oracle or MySQL, substr() is common.

The syntax of the substr() function is:

(1)substr(expr1,expr2)

expr1 refers to the string to be intercepted, and expr2 refers to the starting position of the intercepted string, which is intercepted to the end by default, including the starting position.

(2)substr(expr1,expr2,expr3)

expr1 refers to the string to be intercepted, expr2 refers to the start position of the intercepted string, and expr3 refers to the end position of the string, including the start and end positions.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325938756&siteId=291194637