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>
时间: 2024-10-27 03:02:14