Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Wrap Column values into a single cell with <DIV>

Chandu VenuSep 17 2021 — edited Sep 17 2021

Hello,

Create Table T1_TEMP(ID number, YEAR number, CASES varchar2(10), count number);

insert into T1_TEMP values (1232, 2015,'14-A786',7);
insert into T1_TEMP values (1232, 2016,'13-5767',7);
insert into T1_TEMP values (1232, 2016,'12-G674',7);
insert into T1_TEMP values (1232, 2017,'17-6YG4',7);
insert into T1_TEMP values (1232, 2018,'11-07A5',7);
insert into T1_TEMP values (1232, 2018,'03-1A55',7);
insert into T1_TEMP values (1232, 2018,'03-17A1',7);
insert into T1_TEMP values (1232, 2019,'02-519A',7);
insert into T1_TEMP values (1232, 2020,'07-A594',7);
insert into T1_TEMP values (1232, 2020,'09-A976',7);
insert into T1_TEMP values (1232, 2020,'10-781I',7);
I have data in this format:
image.png

I need to combine the fields YEAR and CASES into one column and have a <DIV> tag for each year. My expected data format is:
image.pngIs that doable? I am looking to get just one row for each ID. Greatly appreciate any help.

Thank You.

This post has been answered by Jan Gorkow on Sep 17 2021
Jump to Answer
Comments
Post Details
Added on Sep 17 2021
8 comments
506 views