-1

我需要你的帮助。我有 2 张桌子。

1.company_classifications

company_name-classifications

Company A-1,2,3

Company B-1,2

2.分类

id-name

1-Music 

2-Technologi

3-Food

我需要查询这样的结果:

company_name-classification_name

Company A-Music, Technologi, Food   

Company B-Music, Food
4

1 回答 1

0
select cc.company_name,group_concat(c.name)
from company_classifications cc 
inner join classifications c 
on c.id = find_in_set(c.id,cc.classifications)
group by cc.company_name;

小提琴

于 2013-07-12T16:40:48.783 回答