答案 0 :(得分:0)
您正在寻找listagg()
。唯一需要注意的是,您需要指定值的排序:
select stdname, listagg(marks, ', ') within group (order by ?) as marks
from t
group by stdname;
如果你想按标记的顺序排列它们:
select stdname, listagg(marks, ', ') within group (order by marks desc) as marks
from t
group by stdname;