oracle中行转列语句参考
发布时间:2020-12-12 15:46:53 所属栏目:百科 来源:网络整理
导读:建表语句: 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 int
建表语句: 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; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |