One to many back to one string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I had a quick search for this but couldn’t find anything.

I have a one to many relationship. Unique ID in table 1 and multiple in
table 2. Table 2 also has a code name for each occurrence. I want these codes
names brought back into one string in table 1 against each ID. I did it the
other day but cannot seem to replicate it.

Thanks in advance for your help

FTJ
 
F said:
Hello

I had a quick search for this but couldn’t find anything.

I have a one to many relationship. Unique ID in table 1
TABLE1
======
1
2


and multiple in
table 2. Table 2 also has a code name for each occurrence.

TABLE2
======
1 CODE_A
1 CODE_B
1 CODE_C
2 CODE_X
2 CODE_Y
2 CODE_Z
I want these codes
names brought back into one string in table 1 against each ID.

This is where I fall off the train...
?
QUERY
=====
1 CODE_A CODE_B CODE_C
2 CODE_X CODE_Y CODE_Z


I did it the
other day but cannot seem to replicate it.

I hate it when that happens..
Thanks in advance for your help

FTJ

Would you provide an example data set and desired results?
 
Here are my intended results:
Table 1
1
2
3

Table 2
1 Apple
1 Pear
1 Carrot
2 Apple
2 Pear
2 Carrot
3 Orange
3 Lemon
3 Lime

Result in table 1

1 Apple, Pear, Carrot
2 Apple, Pear, Carrot
3 Orange, Lemon, Lime


Hope this makes sense
 
Its not concatenation. I've done it before and didn't use this function. its
a one to many relationsship not two fields in one record.
 
Back
Top