我有一個表,我想從該表中回傳基于不同名稱列的資料,該列具有選項串列中對應的多行值。
表資料:

尋找輸出:
Name Options
-----------------------------------
bread white, brown
jam stawberry, apple, mangoe
任何建議或最好的建議都可以接受
uj5u.com熱心網友回復:
這個問題每天都會被問到,你會做
select name, group_concat(options separator ', ')
from t
group by menu_id, name
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/411039.html
標籤:
上一篇:在SQL中遇到條件計數問題
