I don't know how to word this so I'll give it my best shot. I have two tables: a "charges" table and a "people" table:
Code:
C H A R G E S
CASE_ID PEOPLE_ID CHARGE_ID
1 3 16
1 3 18
1 3 21
1 3 32
1 7 16
1 7 18
1 7 21
1 9 16
1 9 11
Code:
P E O P L E
PEOPLE_ID NAME
3 John Doe
7 Jane Smith
9 Duncan Mann
Basically, I want to loop through all these charges and display the distinct charges, with the names of each person associated with those charges. Is this possible? Basically, my results would look like this:
Code:
R E S U L T S
CHARGE_ID NAME
16 John Doe, Jane Smith, Duncan Mann
18 John Doe, Jane Smith
21 John Doe, Jane Smith
32 John Doe
11 Duncan Munn
How can I accomplish this? I don't even know where to start. Thanks!