采用:
SELECt t.*, x.combinedsolutions FROM TICKETS tLEFT JOIN (SELECt s.ticket_id, GROUP_CONCAt(s.soution) AS combinedsolutions FROM SOLUTIONS s GROUP BY s.ticket_id) x ON x.ticket_id = t.ticket_id
备用:
SELECt t.*, (SELECT GROUP_CONCAt(s.soution) FROM SOLUTIONS s WHERe s.ticket_id = t.ticket_id) AS combinedsolutions FROM TICKETS t
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)