mysql 的concat函数可以实现数据库中字段的自由拼接 并且保存成临时字段
mysql> select id,username,concat( id, '-' , username) as truename from pri_admins;
+----+----------+----------+
| id | username | truename |
+----+----------+----------+
| 1 | admin | 1-admin |
| 3 | lanzhe | 3-lanzhe |
| 4 | erin | 4-erin |
| 5 | zlw | 5-zlw |
| 6 | gjy | 6-gjy |
+----+----------+----------+
5 rows in set (0.00 sec)
转自:https://blog.csdn.net/q718330882/article/details/37690677