单字段去重 distinct 返回其他多个字段

时间:2022-11-23 19:54:26

select a.*,
group_concat(distinct b.attribute_name)
from
sign_contract_info a
left join
sign_temp_attribute b
on
a.temp_attribute_id = b.id_
left join
sign_temp_project c
on
a.temp_project_id = c.id_
where
a.enable_=1
AND a.company_info_id = 32
group by b.attribute_name

 

参考

https://www.cnblogs.com/longsanshi/p/7680860.html