The mysql substr function is used to intercept part of a column field in the database. The commonly used syntax is "SBUSTR(str,pos);", which means starting from pos and intercepting to the end.
Recommended: "mysql video tutorial"
The SUBSTR function is used to intercept a part of a certain column field in the database .
The function names in each database are different
MySQL: SUBSTR( ), SUBSTRING( ) Oracle: SUBSTR( ) SQL Server: SUBSTRING( ) ;123
The commonly used method is:
SBUSTR(str,pos); intercept from the starting position of pos to the end.
Another commonly used one is:
SUBSTR(str,pos,len); intercept len characters starting from pos (blanks are also counted as characters).
Note:
The substr() function in mysql and hibernate's substr() parameters are the same, but their meanings are different.
Start in mysql starts from 1, while start in hibernate starts from 0.
The above is the detailed content of What is the usage of mysql substr. For more information, please follow other related articles on the PHP Chinese website!