Skip to content

Instantly share code, notes, and snippets.

@jsntn jsntn/MySQL_concat.sql Secret

Last active Aug 29, 2015
Embed
What would you like to do?
mysql> select concat('10');
+--------------+
| concat('10') |
+--------------+
| 10 |
+--------------+
1 row in set (0.00 sec)
mysql> select concat('11','22','33');
+------------------------+
| concat('11','22','33') |
+------------------------+
| 112233 |
+------------------------+
1 row in set (0.00 sec)
/* MySQL的concat函数在连接字符串的时候,只要其中一个是NULL,那么将返回NULL */
mysql> select concat('11','22',null);
+------------------------+
| concat('11','22',null) |
+------------------------+
| NULL |
+------------------------+
1 row in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.