复制代码 代码如下:
SELECT CONCAT(CAST(int_col AS CHAR), char_col)
复制代码 代码如下:
mysql> select concat('10');
+--------------+
| concat('10') |
+--------------+
| 10 |
+--------------+
row in set (0.00 sec)
mysql> select concat('11','22','33');
+------------------------+
| concat('11','22','33') |
+------------------------+
| 112233 |
+------------------------+
row in set (0.00 sec)
MySQL的concat函数在连接字符串的时候,只要其中一个是NULL,那么将返回NULL
mysql> select concat('11','22',null);
+------------------------+
| concat('11','22',null) |
+------------------------+
| NULL |
+------------------------+
row in set (0.00 sec)
新闻热点
疑难解答