我会用表格更好地解释:
桌子大小
-----------------------------
id | type | size | cont_id |
-----------------------------
1 | GP | 30 | 21 |
2 | FR | 30 | 21 |
3 | UP | 40 | 21 |
4 | GT | 50 | 32 |
5 | UP | 40 | 32 |
-----------------------------
表买
-------------------
cont_id | cus_nam |
-------------------
21 | xxx |
32 | zzz |
------------------
现在我想将两列合并为一列,然后执行 group_concat
这就是我想做的,输出表应该是这样的:
------------------------------------
type | cont_id |
-----------------------------------
30GP ,30FR,40UP | 21 |
50GT , 40UP | 32 |
------------------------------------