Home  >  Article  >  Database  >  How to convert numbers to string in mysql

How to convert numbers to string in mysql

青灯夜游
青灯夜游Original
2021-12-28 16:51:0441823browse

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'';".

How to convert numbers to string in mysql

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn