建表语句:
drop table test purge; create table test(id number,name varchar2(20),score number); insert into test values(1,'a',95); insert into test values(1,'b',82); insert into test values(1,'c',73); insert into test values(2,'d',56); insert into test values(2,'e',74); commit;
字符类型列合并:
select id 代号,wm_concat(name) 合并结果 from test group by id;
非字符类型列合并:
select id 代号,wm_concat(to_char(score)) 合并结果 from test group by id;原文链接:https://www.f2er.com/oracle/211952.html