莫大人

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

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

 

posted on 2018-08-10 15:11  莫大人  阅读(2220)  评论(0编辑  收藏  举报

导航