Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DB2 7.2 ZOS col to row after query

Status
Not open for further replies.

ebaccini

Programmer
Feb 23, 2016
1
0
0
IT
Hi,
I've a query from 2 tables that give me a table like this as an answer:

Code:
select a.COL1, a.COL2, a.COL3, a.COL4,  b.COL5 from db2.tb1 a, db2.tb2 b where  a.COL1 = b.COL1 and  a.COL1 = "VAL1"

COL1     COL2     COL3     COL4     COL5
VAL1     VAL2     VAL3     VAL4     PRB1
VAL1     VAL2     VAL3     VAL4     PRB2

And due to the fact that this query is the base to populate a grid with this data I want to present my result in this other way:

Code:
COL1     COL2     COL3     COL4     COL5
VAL1     VAL2     VAL3     VAL4     PRB1,PRB2

maybe I'm just stupid but I had a lot of difficulties in implement recursive queries and the DB2 version we got does not support XML nor LISTAGG.

Any suggestion?

Thanks in advance
Emiliano
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top