concat的使用
可以拼接多个字符
mysql> select concat(name,dept,job) from t1;
+-----------------------+
| concat(name,dept,job) |
+-----------------------+
| jack销售类sale |
| rose销售类sale |
| tom技术类DBA |
| jerry技术类develop |
| kevin技术类develop |
+-----------------------+
5 rows in set (0.00 sec)
concat_ws的使用
mysql> select concat_ws('|',name,dept,job) from t1;
+------------------------------+
| concat_ws('|',name,dept,job) |
+------------------------------+
| jack|销售类|sale |
| rose|销售类|sale |
| tom|技术类|DBA |
| jerry|技术类|develop |
| kevin|技术类|develop |
+------------------------------+
5 rows in set (0.00 sec)
标签:develop,job,ws,技术类,mysql,concat
From: https://www.cnblogs.com/smyz/p/17010414.html