SUBSTRING (expression, start, length)ParametersexpressionA string, binary string, text, image, column, or an expression that contains a column. Do not use an expression that contains an aggregate function.StartAn integer or an expression that can be
1. Intercept string from left
Left (str, length)
Description: Left (intercepted field, intercept length)
Example: Select Left (content,200) as abstract from my_content_t
2, from the right start to intercept the string
Right (str, length)
Description:
The SUBSTRING function was used when manipulating SQL Server
SUBSTRING (expression, start, length)
Parameters
Expression
A string, binary string, text, image, column, or an expression that contains a column. Do not use an expression that contains
Usage of Mysql string truncation function SUBSTRING description bitsCN.com feels that MySQL string function truncation characters are more powerful than program interception (such as PHP or JAVA), so here is a record, I hope it will be useful to you.
The sense that MySQL's string function intercepts characters is more powerful than using program interception (such as PHP or Java), so make a record here and hope to be useful to everyone.
Function:
1. Intercept string from left
Left (str, length)
Function:1. Intercept the string from left (str, length)Description: Left (truncated field, intercept length) Example: Select Left (content,200) as abstract from my_content_t2. Intercept string Right (str, length)Description: Right (truncated field,
When creating the view today, it is very convenient to use string Truncation in MySQL.
When creating the view today, it is very convenient to use string Truncation in MySQL.
I feel that the string function of MySQL intercepts characters, which is
I feel that the string function of MySQL intercepts characters, which is more powerful than program interceptions (such as PHP or JAVA). So I want to make a record here and hope it will be useful to everyone.Function:1. Extract strings from the left
It feels like MySQL's string function intercepts characters, and is more powerful than a program intercept (like PHP or Java), so make a record here and hope it works for everyone.Function:1. Intercept string from leftLeft (str, length)Description:
SUBSTRING1. SyntaxSUBSTRING (expression, start, length)2. ParametersExpressionIs a string, binary string, text, image, column, or expression that contains a column. Do not use expressions that contain aggregate functions.StartThe integer at the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.