sql >> Base de Datos >  >> RDS >> Oracle

Combinar muchos datos como uno solo

Below check below query 

create table CCSK
 (CCSKIYEARDOULE varchar2(10),
 CCSKIYEAR number);

 begin
 insert into CCSK values ('92-93',92);
 insert into CCSK values ('92-93',93);
 insert into CCSK values ('94-95',94);
 insert into CCSK values ('94-95',95);
 insert into CCSK values ('96-97',97);
end;



 select CCSKIYEARDOULE,listagg(CCSKIYEAR,',')
 from CCSK
 group by CCSKIYEARDOULE;