Two functions in MySQL string processing concat () and left () implement the query results as a percentage, the specific example code below, interested friends can learn
Looking for some information, and then I used the MySQL string processing of two functions concat () and left ()
1, CONCAT (str1,str2,...)
Returns a string from the argument's link. Returns null if any argument is null. can have more than 2 parameters. A numeric parameter is transformed into an equivalent string form.
Example
Copy Code code as follows:
Select CONCAT (' My ', ' S ', ' QL ');
-> ' MySQL '
Select CONCAT (' My ', NULL, ' QL ');
-> NULL
Select CONCAT (14.3);
-> ' 14.3 '
2, left (str,length)
Intercepts a string from the left. Description: Left-Hand (intercepted field, intercept length)
Combined 1, 2:concat (left (value 1/value 2 *100,5), '% ') as complaints