7 Replies Latest reply: Mar 6, 2013 6:29 AM by Solomon Yakobson RSS

    Merge two or more rows in one row

    Star
      Hi Everyone,


      I need to know, how can I merge two(+) rows in sinlge rows.

      Example:

      create table sim_info
      ( sim_no varchar2(20),
      service_code varchar2(20),
      audit_date date
      );

      insert into sim_info (sim_no, service_code, audit_date) values('11111111111111','ABCD',sysdate)
      insert into sim_info (sim_no, service_code, audit_date) values('11111111111111','EFGH',sysdate)
      insert into sim_info (sim_no, service_code, audit_date) values('11111111111111','1234',sysdate)
      insert into sim_info (sim_no, service_code, audit_date) values('11111111111111','0000',sysdate)


      insert into sim_info (sim_no, service_code, audit_date) values('11111111111112','ABCD',sysdate)
      insert into sim_info (sim_no, service_code, audit_date) values('11111111111112','EFGH',sysdate)
      insert into sim_info (sim_no, service_code, audit_date) values('11111111111112','1234',sysdate)
      insert into sim_info (sim_no, service_code, audit_date) values('11111111111112','0000',sysdate)

      I want output like this

      11111111111111, ABCD;EFGH;1234;0000
      11111111111112, ABCD;EFGH;1234;0000

      Can anyone please let me know how to do this?


      Regards,
      Star