This is more of a SQL question than VB, but most of us are well-versed in both, so I thought I would try here first.
Our VB app is tied to a mainframe DB2 database, and the data modelers have of course normalized this to within an inch of it's life. What I would like to do is create a single SQL that will select rows from a table, and as a field in that SELECT statement, include a concatenation of all of the values of a single column in all of the child rows associated with the current row.
So, if I have the following:
Field A Field B Field C
Field X Field Y Field Z
A B C
1 2 3
4 5 6
D E F
7 8 9
10 11 12
13 14 15
....I want to get:
Field A Field B Field C Field D
A B C 1+4
D E F 7+10+13
How can I do this with a single SQL Statement?
Our VB app is tied to a mainframe DB2 database, and the data modelers have of course normalized this to within an inch of it's life. What I would like to do is create a single SQL that will select rows from a table, and as a field in that SELECT statement, include a concatenation of all of the values of a single column in all of the child rows associated with the current row.
So, if I have the following:
Field A Field B Field C
Field X Field Y Field Z
A B C
1 2 3
4 5 6
D E F
7 8 9
10 11 12
13 14 15
....I want to get:
Field A Field B Field C Field D
A B C 1+4
D E F 7+10+13
How can I do this with a single SQL Statement?