How to select duplicate content to column?
TableA
Id  title     prod_cat
--  --------- --------
1   product1  
2   product2 
3   product3
TableB
ID  category_title
--  --------------
1   category1
2   category2
3   category3
TableC
ID prod_id cat_id
-- ------- ------
1  1       1  
2  1       2  
3  2       3  
How to show content like this? If product have multicategory in rows in table show category name in next column?
TableOutput
prod_id  cat_id    cat_id2
-------- --------- ----------
produkt1 category1 category2
produkt2 category3 NULL
produkt3 NULL      NULL
 
    