MYSQL复杂连接一对多

MYSQL复杂连接一对多,mysql,one-to-many,group-concat,Mysql,One To Many,Group Concat,我有以下表格: 客户: 联系人: 客户联系方式: 提供: 我希望通过最佳选择获得: | id_client | name | code | zone | contacts_pers | total_offer_value | ---------------------------------------------------------------------------- | 1 | client 1 | a1b1 | zone1 | first1 last1; |

我有以下表格:

客户:

联系人:

客户联系方式:

提供:

我希望通过最佳选择获得:

| id_client | name | code | zone | contacts_pers | total_offer_value | ---------------------------------------------------------------------------- | 1 | client 1 | a1b1 | zone1 | first1 last1; | 600 | first2 last2; first3 last3; | 2 | client 2 | a2b2 | zone2 | first1 last1; | 400 | first4 last4;
我知道如何使用group_concat和total_offer_value的存储过程获得所需的结果。但是如何从单个有效选择中获得所需的结果?

选择c.id、c.name、c.code、c.zone、GROUP\u CONCATco.first\u name、c.last\u name分隔符;作为联系人,func\u total\u offer\u value c.id作为total\u offer\u value

来自客户c

左外联接客户端\联系人cc,c.id=cc.id\客户端上的联系人co和cc.id\联系人=co.id\联系人
按c.id分组

能否将当前查询粘贴到问题? | id_contact | first_name | last_name | ---------------------------------------- | 11 | first1 | last1 | | 22 | first2 | last2 | | 33 | first3 | last3 | | 44 | first4 | last4 | | id_client | id_contact | -------------------------- | 1 | 11 | | 1 | 22 | | 1 | 33 | | 2 | 11 | | 2 | 44 | | id_offer | id_client | value | -------------------------- | 111 | 1 | 100 | | 222 | 1 | 200 | | 333 | 1 | 300 | | 444 | 2 | 400 | | id_client | name | code | zone | contacts_pers | total_offer_value | ---------------------------------------------------------------------------- | 1 | client 1 | a1b1 | zone1 | first1 last1; | 600 | first2 last2; first3 last3; | 2 | client 2 | a2b2 | zone2 | first1 last1; | 400 | first4 last4;