oracle数据库查询问题 有张表数据如下:useid username course 1 a A 1 a B 2 b

oracle数据库查询问题 有张表数据如下:useid username course 1 a A 1 a B 2 b A 2 b C 3 c C 4 d null
怎么查询,结果如下:
userid username course
1 a A,B
2 b A,C
3 c C
4 d
表数据为:
userid username course
1 a A
1 a B
2 b A
2 b C
3 c C
4 d
想得到结果如下:
userid username course
1 a A,B
2 b A,C
3 c C
4 d
香阁移春 1年前 已收到1个回答 举报

thunder_222 幼苗

共回答了20个问题采纳率:90% 举报

oracle 10g 之后的版本(含10g)
select userid,username,WMSYS.WM_CONCAT(course) from 表 group by userid,username

1年前

5
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 17 q. 0.076 s. - webmaster@yulucn.com