萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> mysql教程 >> MySQL 帶分隔符的字符連接 concat_ws 與concat

MySQL 帶分隔符的字符連接 concat_ws 與concat

MySQL 帶分隔符的字符連接 concat_ws 與concat

mysql教程> select concat_ws('-','123',456,'789');
+--------------------------------+
| concat_ws('-','123',456,'789') |
+--------------------------------+
| 123-456-789                    |
+--------------------------------+
1 row in set (0.02 sec)

mysql>

concat實例

mysql> select concat('123',456);
+-------------------+
| concat('123',456) |
+-------------------+
| 123456            |
+-------------------+
1 row in set (0.00 sec)

mysql> select concat('123',456,'789');
+-------------------------+
| concat('123',456,'789') |
+-------------------------+
| 123456789               |
+-------------------------+
1 row in set (0.00 sec)

mysql>

copyright © 萬盛學電腦網 all rights reserved