title: How can i do this multiple JOIN query?
body: <p>I need to build a query with multiple JOIN, to be more especific, 2 JOINS, but it gets duplicated results, check this:</p>
  
  <p>My current tables:</p>
  
  <p>food_shops</p>
  
  <pre><code>id, slug, name
  </code></pre>
  
  <p>categories_food_shops</p>
  
  <pre><code>id, id_cat, id_food_shop
  </code></pre>
  
  <p>pictures_food_shops</p>
  
  <pre><code>id, pic_slug, id_food_shop
  </code></pre>
  
  <p>And I need to get * from food_shops, the id_cat from categories_food_shops and pic_slug from pictures_food_shops... </p>
  
  <p>My current query is like this:</p>
  
  <pre><code>SELECT food_shops.id, food_shops.slug, food_shops.name, 
  GROUP_CONCAT(categories_food_shops.id_category) as categories, 
  GROUP_CONCAT(pictures_food_shops.slug) as pictures 
  FROM
  food_shops 
  JOIN categories_food_shops 
      ON food_shops.id = categories_food_shops.id_food_shop 
  JOIN pictures_food_shops 
      ON food_shops.id = pictures_food_shops.id_food_shop 
  GROUP BY food_shops.slug, pictures_food_shops.id_food_shop
  </code></pre>
  
  <p>But since my pictures_food_shops have more results as the categories_food_shops, my result is gettin "quadruplicated":</p>
  
  <p><a href="https://i.stack.imgur.com/yeG5r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yeG5r.png" alt="enter image description here"></a></p>
  
  <p>What can I do to prevent this and get only the correct amount of categories?
  Only 1 at the first row, 3 and 5 in the second one and 7,1,6 at the last one?</p>
  
  <p>Thanks!</p>