mysql character function interception substring (param1, param2, param3) usage

 

substring (paramter1, paramter2, paramter3) intercept length field

paramter1 intercepted field
paramter2 taken from several starts, a negative number indicates the number from the end, the number of bits taken starts
when taken paramter3 how many bits are omitted, taken to represent the final

 

Example:
the substring (best123456,2,3) results EST
the substring (best123456,2) results est123456
the substring (best123456, -5,3) result 234
the substring (best123456, -5) the result is 23456

Guess you like

Origin www.cnblogs.com/whitemouseV2-0/p/11795215.html