1.concat
Select as from String_test;
Concat is to concatenate multiple strings together, where you can specify a delimiter (in fact, the string '-' is output to a false separation effect), as follows:
Select concat (first_name,'-' as from String_test;
2.concat_ws
Select concat_ws ('-' as from String_test;
Note: The Concat_ws delimiter is in the first parameter, what is it different from concat? As follows:
Select concat ("|", "A", "B", "C");
With CONCAT_WS can make each word between the existence of separators, to achieve a true separation effect, we look at Concat:
Select concat ("|", "A", "B", "C");
3.format ()
Select Format (19986.78,1);
Format accepts two parameters, the first parameter represents the number to be formatted, and the second parameter represents the number of digits holding the decimal point, where a valid number is retained by rounding.
Select Format (19986.78,2);
3.lower ()
Select Lower ('MYSQL');
The lower () function converts the string to lowercase, and the above code executes the following result:
3.upper ()
Effect contrary to lower
4.left ()
Gets the character to the left of the string, accepts two parameters, the first parameter is the parent string to get, and the second parameter is the length of the fetch, as follows:
Select Left ('mysql',2);
The function above means: Get a string of length 2 from the left side of MySQL.
5.right ()
Gets the string to the right, as with left.
6.length ()
Gets the length of the string
Select Length ('mysql');
7.ltrim ()
Remove leading spaces
8.rtrim ()
Delete subsequent spaces
9.trim ()
Remove leading and trailing spaces
If a string is such a ===> "??? MySQL???? "
So how do you delete a leading question mark and a subsequent question mark? As follows:
To delete a leading question mark:
Select from "??? MySQL???? ");
Leading means the leading meaning.
Delete subsequent question marks:
Select from "??? MySQL???? ");
Delete all question marks:
Select from "??? MySQL???? ");
MySQL character function