select CONCAT_WS(',',(case when c.b_drug_addicts = '1' then '吸毒人员' else null end)
,(case when c.b_released_fromprison = '1' then '刑满释放人员' else null end)
,(case when c.b_social_correctional_personnel = '1' then '社区矫正人员' else null end)
,(case when c.b_mental_patient = '1' then '精神障碍患者' else null end)
,(case when c.b_dangerous_goods_practitioners = '1' then '危险品从业人员' else null end)
,(case when c.b_visiting_personnel = '1' then '信访人员' else null end)
,(case when c.b_repeat_visitor = '1' then '重复上访人员' else null end)
,(case when c.b_key_teenagers = '1' then '重点青少年' else null end)
,(case when c.b_involved_criminal_cases = '1' then '涉刑事案件' else null end)
,(case when c.b_involved_civil_disputes = '1' then '涉民事纠纷案件' else null end)
,(case when c.b_evil_related_personnel = '1' then '涉邪人员' else null end)
,(case when c.b_gambling_related = '1' then '涉赌人员' else null end)
,(case when c.b_dishonest = '1' then '失信人员' else null end)
,(case when c.b_stabilization = '1' then '涉稳人员' else null end)
,(case when c.b_pyramid_sale = '1' then '传销人员' else null end)
,(case when c.b_law_litigation_related = '1' then '涉法涉诉人员' else null end)
,(case when b.b_disabled = '1' then '残疾人' else null end)
,(case when b.b_low_income_households = '1' then '低保户' else null end)
,(case when b.b_people_need_rescue = '1' then '临时救助人员' else null end)
,(case when b.b_extremely_poor_people = '1' then '特困人员' else null end)
,(case when b.b_dbbyry = '1' then '是否低保边缘人员' else null end)
,(case when b.b_orphan = '1' then '孤儿' else null end)
,(case when b.b_disabled_soldiers = '1' then '残疾军人' else null end)
,(case when b.b_family_dependants = '1' then '烈士遗属' else null end)
,(case when b.b_children_distress = '1' then '困境儿童' else null end)
,(case when b.b_left_behind_children_zw = '1' then '留守儿童' else null end)
,(case when b.b_low_income = '1' then '低收入人员' else null end)
,(case when b.b_have_prison_minor_child = '1' then '服刑在教未成年人子女' else null end)
,(case when b.b_ex_servicemen = '1' then '在乡复员军人' else null end)
,(case when b.b_lost_only_child = '1' then '失独人员' else null end)) as tag
from dws_person as a
left join dws_person_help_info as b
on a.m_id_card_no = b.m_id_card_no
left join dws_person_control_info as c
on a.m_id_card_no = c.m_id_card_no
where a.m_id_card_no = '51082320060926567X'
这个sql代码正常来说应该只返回一个值,但是不知道为什么会传回多个结果。想知道该怎么解决。