I have two tables. They are:
Table 1: test_static with two fields: sName and phone
It includes the follow records:
sName; phone
Bob; 111-1111
Jim; 222-2222
Sam; 333-3333
Table 2: test_records with two fields: rName and date
rName; date
Bob; 1/1/2009
Bob; 1/1/2010
Bob; 1/1/2011
Jim; 2/2/2010
Jim; 2/2/2011
Sam; 3/3/2008
Sam; 3/3/2009
Sam; 3/3/2010
Sam; 3/3/2011
I need output that combines the above tables and that looks like:
Row 1: Bob; 111-1111; 1/1/2009, 1/1/2010, 1/1/2011
Row 2: Jim; 222-2222; 2/2/2010, 2/2/2011
Row 3: Sam; 333-3333, 3/3/2008, 3/3/2009, 3/3/2010, 3/3/2011
I have tried many different SELECT statements with a variety of JOINs and coding approaches, but I cannot figure this out. I have used kludges for months to get around my poor programming abilities, and I am looking for a “real” solution. I don’t have a formal programming background (this may be obvious). Could anyone please offer a coding solution (or hints) that produces the above output?
Thank you!