Skip to content

Instantly share code, notes, and snippets.

@jsntn
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsntn/548f82a1c7b43cf1a554 to your computer and use it in GitHub Desktop.
Save jsntn/548f82a1c7b43cf1a554 to your computer and use it in GitHub Desktop.
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