I have a table from which I want to return data based on a distinct name column with correspondent multiple row values from the options column table.
Table data:
Looking Output:
Name Options
-----------------------------------
bread white, brown
jam stawberry, apple, mangoe
Any suggestion or best advice is apprecheated
CodePudding user response:
This question is asked every day without fail, you would simply do
select name, group_concat(options separator ', ')
from t
group by menu_id, name

