This is an automated archive.

The original was posted on /r/mysql by /u/FerreKijker on 2023-08-06 13:00:15+00:00.


hey ,

with this qwery i have a good result (1 GROUP_CONTACT())

select recipes.idrecipes,recipes.title,recipes.images,recipes.creatiedatum,(GROUP_CONCAT(i.name SEPARATOR '+')) as ingredients

from epicurious.recipes

left join ingredients i on recipes.idrecipes = i.recipes_idrecipes

where recipes.idrecipes >= 1 and recipes.idrecipes <= 12

group by recipes.idrecipes

but i likt to use (2 GROUP_CONTACT()) in my qwery, just like this:

select recipes.idrecipes,recipes.title,recipes.images,recipes.creatiedatum,(GROUP_CONCAT(i.name SEPARATOR '+') ) as ingredients, GROUP_CONCAT(ins.instuction SEPARATOR '+') as instruction from epicurious.recipes

left join ingredients i on recipes.idrecipes = i.recipes_idrecipes

left join instructions ins on recipes.idrecipes = ins.recipes_idrecipes

where recipes.idrecipes >= 1 and recipes.idrecipes <= 12

group by recipes.idrecipes;

in the first qwery my result is as I want it, ( a string with all my value from ingredients.name where ingredients. id is the same.

| id | ingredients.


| 1 | 1 (3½-4-lb.) whole chicken+2¾ tsp. kosher salt,+…

but with the second qwery the colum ‘instruction’ is good but in my colom is ingredients the value of each cell is the first value but repeating with a + sign in between

| id | ingredients | instruction


| 1 | 1 (3½-4-lb.) whole chicken+1 (3½-4-lb.) whole chicken,+… | Pat chicken dry with paper towels, season all over with 2 tsp. salt, and tie legs together with kitchen twine. +

why is this and what can I do about it?

greetings