Mysql method of converting numbers to strings: 1. Use the CHAR() function, syntax "SELECT CONVERT (numeric value, CHAR);"; 2. Use the " " operator to combine numbers with the empty string Addition, syntax "SELECT value'';".
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
mysql converts numbers into strings
1. If numbers are converted into strings, you can use CHAR. Take a look at sql Statement:
SELECT CONVERT(23,CHAR);
The running results are shown in the figure below.
2. To convert numbers into strings, you can also directly use the "''" method. The sql statement is as follows:
SELECT 123+'';
The running result of this sql is as shown in the figure.
[Related recommendations: mysql video tutorial]
The above is the detailed content of How to convert numbers to string in mysql. For more information, please follow other related articles on the PHP Chinese website!